/* Sahab — design tokens */
:root {
  --bg: #F2F4F8;
  --surface: #FFFFFF;
  --surface-2: #E9EDF3;
  --ink: #1B2433;
  --muted: #5B6678;
  --line: #DCE2EB;
  --accent: #E8A23D;
  --accent-hover: #D6912C;
  --accent-ink: #9A6A15;
  --on-accent: #241A07;
  --good: #2E9268;
  --bad: #CC4444;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 8px 28px rgba(20, 30, 50, .07);
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1420;
    --surface: #16202F;
    --surface-2: #1D2A3C;
    --ink: #E9EFF7;
    --muted: #8B97A8;
    --line: #263349;
    --accent: #F0AC4B;
    --accent-hover: #F7BC68;
    --accent-ink: #F0AC4B;
    --on-accent: #241A07;
    --good: #4CC08D;
    --bad: #E06060;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 32px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="light"] {
  --bg: #F2F4F8; --surface: #FFFFFF; --surface-2: #E9EDF3; --ink: #1B2433;
  --muted: #5B6678; --line: #DCE2EB; --accent: #E8A23D; --accent-hover: #D6912C;
  --accent-ink: #9A6A15; --on-accent: #241A07; --good: #2E9268; --bad: #CC4444;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 8px 28px rgba(20, 30, 50, .07);
}
:root[data-theme="dark"] {
  --bg: #0E1420; --surface: #16202F; --surface-2: #1D2A3C; --ink: #E9EFF7;
  --muted: #8B97A8; --line: #263349; --accent: #F0AC4B; --accent-hover: #F7BC68;
  --accent-ink: #F0AC4B; --on-accent: #241A07; --good: #4CC08D; --bad: #E06060;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 32px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, .brand-name { font-family: "Alexandria", "IBM Plex Sans Arabic", sans-serif; }
.mono { font-family: "IBM Plex Mono", monospace; }
a { color: var(--accent-ink); text-decoration: none; }

/* ---------- header ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 700;
  font-size: 19px;
}
.logo { width: 30px; height: 30px; color: var(--muted); }
.nav { display: flex; align-items: center; gap: clamp(12px, 2.5vw, 26px); }
.nav a { color: var(--muted); font-weight: 500; font-size: 14px; }
.nav a:hover { color: var(--ink); }
.nav a.lang { color: var(--accent-ink); }
.langpick { position: relative; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 5px 12px;
  cursor: pointer;
}
.lang-btn:hover { color: var(--ink); border-color: var(--muted); }
.lang-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  list-style: none;
  margin: 0;
  padding: 6px;
  min-width: 150px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lang-menu a {
  display: block;
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
}
.lang-menu a:hover { background: var(--surface-2); color: var(--accent-ink); }
.lang-btn:focus-visible, .lang-menu a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--muted); cursor: pointer;
}
.theme-btn:hover { color: var(--ink); border-color: var(--muted); }

/* ---------- layout ---------- */
.main {
  width: min(860px, 100% - 32px);
  margin-inline: auto;
  padding-block: clamp(28px, 5vh, 56px) 48px;
  flex: 1;
}
.foot {
  padding: 18px clamp(16px, 4vw, 40px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- hero ---------- */
.hero { text-align: center; margin-bottom: clamp(24px, 4vh, 40px); }
.hero h1 {
  font-size: clamp(26px, 4.5vw, 40px);
  font-weight: 700;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.hero-sub {
  color: var(--muted);
  max-width: 46ch;
  margin: 10px auto 0;
  text-wrap: balance;
}
.hero-sm { margin-bottom: 20px; }
.hero-sm h1 { font-size: clamp(22px, 3.5vw, 30px); }

/* ---------- panel & tabs ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(16px, 3vw, 28px);
}
.tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.tab {
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.on {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line);
}

/* ---------- dropzone ---------- */
.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: clamp(30px, 6vh, 54px) 20px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  text-align: center;
  transition: border-color .15s, background .15s;
}
.drop.over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--bg));
}
.drop-icon { width: 54px; height: 54px; color: var(--muted); transition: transform .2s; }
.drop.over .drop-icon { transform: translateY(-4px); }
.drop-hint { font-weight: 700; font-size: 17px; }
.drop-or { color: var(--muted); font-size: 13px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--accent-hover); }
.btn-lg { padding: 12px 30px; font-size: 16px; }
.btn-ghost {
  background: none;
  color: var(--accent-ink);
  border: 1px solid var(--line);
  font-weight: 500;
  white-space: nowrap;
}
.btn-ghost:hover { background: var(--surface-2); }
.input {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  width: 100%;
}
.input:focus-visible, .btn:focus-visible, .tab:focus-visible, .theme-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.input.mono { font-size: 13px; }

.remote-form { display: flex; gap: 10px; }
.remote-form .btn { flex-shrink: 0; }

/* ---------- options ---------- */
.opts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.opt { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.opt input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.opt-pw .input { width: 150px; padding-block: 6px; }

/* ---------- queue ---------- */
.queue { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.queue:not(:empty) { margin-top: 18px; }
.qrow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.qname { font-weight: 500; overflow-wrap: anywhere; }
.qsize { color: var(--muted); font-size: 12.5px; }
.qbar {
  grid-column: 1 / -1;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}
.qbar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
  transition: width .2s;
}
.qrow.ok .qbar i { background: var(--good); width: 100%; }
.qrow.err .qbar i { background: var(--bad); width: 100%; }
.qstatus { font-size: 12.5px; color: var(--muted); }
.qrow.ok .qstatus { color: var(--good); }
.qrow.err .qstatus { color: var(--bad); }
.qlinks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.qlinks .mini {
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent-ink);
  cursor: pointer;
  font-family: inherit;
}
.qlinks .mini:hover { background: var(--surface-2); }

/* ---------- my files ---------- */
.mine { margin-top: 34px; }
.sec-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.mine-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mine-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.mine-row a { font-weight: 500; overflow-wrap: anywhere; flex: 1; color: var(--ink); }
.mine-row a:hover { color: var(--accent-ink); }
.mine-size { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.mine-del {
  border: none; background: none; color: var(--bad);
  font: inherit; font-size: 12.5px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.mine-del:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 34px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: center;
}
.stat-num { display: block; font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 12.5px; }
.stat-good .stat-num { color: var(--good); }

/* ---------- file page ---------- */
.filecard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3.5vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.file-name { font-size: clamp(19px, 3vw, 26px); font-weight: 700; overflow-wrap: anywhere; }
.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 10px;
  font-size: 13px;
}
.file-meta div { display: flex; gap: 8px; }
.file-meta dt { color: var(--muted); }
.file-meta dd { font-variant-numeric: tabular-nums; }
.preview { text-align: center; }
.preview-img { max-width: 100%; max-height: 55vh; border-radius: 8px; }
.preview-media { width: 100%; border-radius: 8px; }
.preview-pdf { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: 8px; }
.preview-none {
  padding: 26px;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}
.dl-area { text-align: center; }
.pw-form { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pw-note { color: var(--muted); }
.pw-wrong { color: var(--bad); font-weight: 500; }
.pw-row { display: flex; gap: 10px; width: min(420px, 100%); }
.linkbox-label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.linkbox-row { display: flex; gap: 8px; }

/* ---------- catalogue ---------- */
.cat-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cat-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.cat-name { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.cat-name:hover { color: var(--accent-ink); }
.cat-cell { color: var(--muted); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ---------- auth ---------- */
.inline { display: inline; }
.navbtn {
  border: none; background: none; color: var(--muted);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; padding: 0;
}
.navbtn:hover { color: var(--bad); }
.nav-user { font-weight: 700; }
.auth-wrap { display: flex; justify-content: center; }
.auth-card { width: min(430px, 100%); }
.auth-title { font-size: 22px; font-weight: 700; margin-bottom: 18px; text-align: center; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); }
.field-hint { font-size: 12.5px; color: var(--muted); }
.auth-err { color: var(--bad); font-weight: 500; font-size: 14px; }
.auth-submit { justify-content: center; }
.auth-note { font-size: 12.5px; color: var(--muted); text-align: center; }
.auth-alt { text-align: center; margin-top: 16px; font-size: 14px; }

/* ---------- account ---------- */
.acc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.acc-sec { margin-bottom: 16px; }
.acc-grid .acc-sec { margin-bottom: 0; }
.kv { display: flex; flex-direction: column; gap: 8px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv-good { color: var(--good); }
.kv-warn { color: var(--accent-ink); }
.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--muted);
}
.badge-good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.twofa-state { margin-bottom: 12px; }
.twofa-setup { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.twofa-qr svg { background: #fff; border-radius: 8px; max-width: 180px; height: auto; }
.twofa-secret {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.btn-danger {
  border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent);
  background: none;
  color: var(--bad);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); }
.sess-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sess-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.sess-info { display: flex; flex-direction: column; gap: 2px; }
.sess-dev { font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sess-meta { color: var(--muted); font-size: 12px; direction: ltr; text-align: start; }
.acc-fname { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- encryption ---------- */
.opt-enc { display: inline-flex; align-items: center; gap: 6px; }
.opt-enc svg { color: var(--accent-ink); }
.enc-note { display: flex; align-items: center; justify-content: center; gap: 8px; }
.enc-state { margin-bottom: 12px; color: var(--good); font-size: 14px; }
.enc-state.enc-nokey { color: var(--bad); }
.enc-keep { margin-top: 12px; font-size: 12.5px; color: var(--muted); max-width: 52ch; margin-inline: auto; }
.qnote { font-size: 11.5px; color: var(--accent-ink); flex-basis: 100%; }
#encDlBtn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- admin (CDN mod) ---------- */
.srv-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.srv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.srv-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.srv-name { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.srv-meta { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.srv-bar {
  width: min(260px, 100%);
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.srv-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.srv-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.srv-actions .mini {
  font-size: 12.5px; font-weight: 500; padding: 4px 12px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--accent-ink);
  cursor: pointer; font-family: inherit;
}
.srv-actions .mini:hover { background: var(--surface-2); }
.srv-actions .mini.msg-bad { color: var(--bad); border-color: var(--bad); }
.srv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.srv-wide { grid-column: 1 / -1; }
.srv-form-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
.srv-form-btns { display: flex; gap: 10px; }
.srv-form-msg { font-size: 13px; font-weight: 500; }
.msg-good { color: var(--good); }
.msg-bad { color: var(--bad); }
.xfer-controls { display: flex; align-items: end; gap: 12px; margin: 14px 0; flex-wrap: wrap; }
.xfer-controls .field { min-width: 180px; }
.xfer-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.xfer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}
.xfer-row .qbar { grid-column: 1 / -1; }
.xfer-status { color: var(--muted); }
.xfer-done .xfer-status { color: var(--good); }
.xfer-error .xfer-status { color: var(--bad); }
.xfer-done .qbar i { background: var(--good); }
.xfer-error .qbar i { background: var(--bad); }

/* ---------- link hub ---------- */
.host-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px 16px;
  margin-top: 16px;
}
.host-field span:first-child { font-size: 13.5px; }
.qhosts { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }
.host-note { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.host-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.chip-label { font-size: 12.5px; color: var(--muted); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.chip::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
}
.chip-ok::before { background: var(--good); }
.chip-dead { color: var(--muted); }
.chip-dead::before { background: var(--bad); }
.host-chips .mini {
  font-size: 12px; padding: 3px 12px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--accent-ink); cursor: pointer; font-family: inherit;
}
.host-chips .mini:hover { background: var(--surface-2); }
.link-dead {
  color: var(--bad);
  font-weight: 500;
  margin-bottom: 14px;
  max-width: 48ch;
  margin-inline: auto;
}
.how { margin-top: 38px; }
.how-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.how-list li {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.how-n {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 500;
}
.how-list b { font-size: 14.5px; }
.how-list p { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- admin: hosting sites ---------- */
.link-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.link-stats .stat { background: var(--bg); }
.stat-bad .stat-num { color: var(--bad); }
.prov-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.prov-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.prov-name { font-weight: 500; }
.prov-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.prov-site { font-size: 12px; }
.prov-key-row { grid-template-areas: 'a b c' 'd d d'; }
.prov-key {
  grid-area: d;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.prov-key-input { flex: 1; font-size: 12.5px; padding-block: 6px; }
.prov-key .field-hint { white-space: nowrap; color: var(--accent-ink); }

/* ---------- decrypt tool ---------- */
.drop-sm { padding: 30px 20px; }
.drop-sm .drop-icon { width: 40px; height: 40px; }
.drop.has-file { border-style: solid; border-color: var(--good); }
.drop.has-file .drop-hint { overflow-wrap: anywhere; }
.dec-key { margin-top: 18px; }
.enc-manual {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.enc-manual-note { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.enc-manual-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero h1 .logo, .hero h1 svg { vertical-align: -2px; }

/* ---------- blog ---------- */
.post-list { display: flex; flex-direction: column; gap: 12px; }
.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.post-card h2 { font-size: 19px; font-weight: 700; text-wrap: balance; }
.post-card h2 a { color: var(--ink); }
.post-card h2 a:hover { color: var(--accent-ink); }
.post-desc { color: var(--muted); font-size: 14px; margin-top: 6px; max-width: 72ch; }
.post-meta { color: var(--muted); font-size: 12.5px; margin-top: 10px; }

.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent-ink); }

.post {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 38px);
}
.post-head { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 22px; }
.post-head h1 {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.35;
  text-wrap: balance;
}
.toc {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 26px;
}
.toc-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.toc ol { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 5px; }
.toc a { font-size: 14px; }

.post-body { max-width: 68ch; }
.post-body h2 {
  font-family: "Alexandria", "IBM Plex Sans Arabic", sans-serif;
  font-size: 21px;
  font-weight: 700;
  margin-top: 34px;
  margin-bottom: 10px;
  scroll-margin-top: 20px;
  text-wrap: balance;
}
.post-body h3 { font-size: 17px; font-weight: 700; margin-top: 24px; margin-bottom: 8px; }
.post-body p { margin-bottom: 14px; line-height: 1.85; }
.post-body ul, .post-body ol {
  margin: 0 0 16px;
  padding-inline-start: 24px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.post-body li { line-height: 1.75; }
.post-body blockquote {
  border-inline-start: 3px solid var(--accent);
  background: var(--bg);
  padding: 12px 18px;
  margin: 0 0 18px;
  border-radius: 0 8px 8px 0;
}
[dir="rtl"] .post-body blockquote { border-radius: 8px 0 0 8px; }
.post-body blockquote p { margin: 0; color: var(--muted); }
.post-body code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
}
.post-body pre {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  margin-bottom: 16px;
  direction: ltr;
  text-align: start;
}
.post-body pre code { background: none; padding: 0; font-size: 12.5px; }
.post-body hr { border: none; border-top: 1px solid var(--line); margin: 26px 0; }
.post-body strong { font-weight: 700; }

.post-cta {
  margin-top: 26px;
  padding: 26px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.post-cta p { color: var(--muted); margin-bottom: 16px; text-wrap: balance; }

.related { margin-top: 32px; }
.related-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.related-list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
}
.related-list a { font-weight: 500; }

/* ---------- why section ---------- */
.why { margin-top: 40px; }
.why-intro {
  color: var(--muted);
  max-width: 68ch;
  margin-bottom: 20px;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.why-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.why-item h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  font-family: "Alexandria", "IBM Plex Sans Arabic", sans-serif;
}
.why-item p { color: var(--muted); font-size: 13.5px; }

/* ---------- FAQ ---------- */
.faq { margin-top: 38px; }
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 18px;
}
.faq-item summary {
  cursor: pointer;
  padding: 14px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  margin-inline-start: auto;
  color: var(--accent-ink);
  font-size: 20px;
  line-height: 1;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item summary h3 {
  font-size: 15px;
  font-weight: 500;
  display: inline;
  font-family: inherit;
}
.faq-item p {
  color: var(--muted);
  font-size: 14px;
  padding-bottom: 16px;
  max-width: 70ch;
}
.faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 50;
}
[dir="rtl"] .toast { transform: translateX(50%); }
.toast.show { opacity: 1; }

@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  .acc-grid { grid-template-columns: 1fr; }
  .srv-grid { grid-template-columns: 1fr; }
  .host-row { grid-template-columns: 1fr; }
  .how-list { grid-template-columns: 1fr; }
  .srv-row { flex-direction: column; align-items: stretch; }
  .cat-row { grid-template-columns: 1fr auto; }
  .cat-date { display: none; }
  .remote-form { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
