/* ============================================================
   ZiroPDF — Free Online PDF Tools
   Design System & Global Styles
   ============================================================ */

:root {
  /* Colors: 1 primary + neutrals + 1 accent */
  --primary: #0f766e;
  --primary-hover: #115e59;
  --primary-soft: #f0fdfa;
  --accent: #d97706;
  --bg: #ffffff;
  --surface: #f8fafc;
  --ink: #0f172a;
  --muted: #5b6676;
  --border: #e2e8f0;
  --danger: #b91c1c;
  --success: #15803d;

  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 24px rgba(15, 23, 42, 0.08);
  --font-sans: "Inter", "Tajawal", system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans Arabic", "Noto Sans Devanagari", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;

  --container: 1140px;
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

/* Hide page until the correct language is applied (prevents flash of
   untranslated English content). The boot script in each page <head>
   adds .omni-boot; omniApplyLang() removes it once translated. */
html.omni-boot body { visibility: hidden; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

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

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; }
.logo svg { flex-shrink: 0; }
.logo .logo-mark { color: var(--logo-color, var(--primary)); }
.logo .logo-accent { color: var(--logo-color, var(--primary)); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.925rem;
  padding: 8px 12px;
  border-radius: 8px;
}
.main-nav a:hover {
  background: var(--surface);
  text-decoration: none;
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Language switcher */
.lang-switch {
  position: relative;
}
.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.lang-btn:hover { border-color: var(--primary); }
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  min-width: 160px;
  padding: 6px;
  display: none;
  z-index: 60;
}
.lang-menu.open { display: block; }
.lang-menu button {
  display: block;
  width: 100%;
  text-align: start;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--ink);
}
.lang-menu button:hover { background: var(--surface); }
.lang-menu button.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: var(--ink);
}

/* ============ Hero ============ */
.hero {
  background: linear-gradient(180deg, var(--primary-soft) 0%, var(--bg) 100%);
  padding: 64px 0 48px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 800px;
  margin: 0 auto 16px;
  text-wrap: balance;
}

.hero p {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
  text-wrap: pretty;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}
.hero-badges span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.hero-badges svg { color: var(--success); }

/* ---- Split hero (text only) ---- */
.hero-split { text-align: center; padding: 56px 0 40px; }
.hero-cols {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
}
.hero-copy { flex: 0 1 720px; min-width: 0; }
.hero-split .hero-copy h1 { margin: 0 0 16px; max-width: none; }
.hero-split .hero-copy p { margin: 0 auto; max-width: 560px; }
.hero-split .hero-badges { justify-content: center; }
.hero-split .hero-actions { justify-content: center; }
.hero-visual { flex: 1 1 44%; min-width: 0; }
.hero-visual img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -24px rgba(15, 118, 110, 0.35);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.btn-hero-primary,
.btn-hero-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 13px 28px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-hero-primary { background: var(--primary); color: #fff; }
.btn-hero-primary:hover { background: var(--primary-hover); color: #fff; text-decoration: none; }
.btn-hero-ghost { background: var(--bg); color: var(--ink); border: 1px solid var(--border); }
.btn-hero-ghost:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 40px;
  padding: 20px 8px;
  border-top: 1px solid var(--border);
}
.hero-stats .stat {
  flex: 1 1 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.hero-stats strong {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
}
.hero-stats span { font-size: 0.875rem; color: var(--muted); font-weight: 600; }

@media (max-width: 860px) {
  .hero-cols { flex-direction: column-reverse; gap: 28px; }
  .hero-split { text-align: center; }
  .hero-split .hero-copy p { margin-inline: auto; }
  .hero-split .hero-badges,
  .hero-actions { justify-content: center; }
  .hero-visual { max-width: 440px; }
}

/* ============ Showcase (illustrated explainers) ============ */
.showcase { padding: 56px 0 8px; }
.showcase-row {
  display: flex;
  align-items: center;
  gap: 48px;
  margin-bottom: 56px;
}
.showcase-row-flip { flex-direction: row-reverse; }
.showcase-img { flex: 1 1 44%; min-width: 0; }
.showcase-img img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--primary-soft);
}
.showcase-text { flex: 1 1 52%; min-width: 0; }
.showcase-text h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  text-wrap: balance;
}
.showcase-text p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0 0 18px;
  text-wrap: pretty;
}
.showcase-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}
.showcase-link::after { content: "→"; transition: transform 0.15s ease; }
[dir="rtl"] .showcase-link::after { content: "←"; }
.showcase-link:hover::after { transform: translateX(3px); }
[dir="rtl"] .showcase-link:hover::after { transform: translateX(-3px); }

@media (max-width: 860px) {
  .showcase-row,
  .showcase-row-flip { flex-direction: column; gap: 24px; margin-bottom: 48px; text-align: center; }
  .showcase-img { max-width: 420px; }
}

/* ============ Tools Grid ============ */
.tools-section { padding: 48px 0 64px; }

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.section-sub {
  color: var(--muted);
  margin-bottom: 28px;
}

.category-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 36px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.category-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.tool-card:hover {
  text-decoration: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tool-card .tool-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.tool-card h3 {
  font-size: 1rem;
  font-weight: 700;
}
.tool-card p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ============ Tool Page ============ */
.tool-hero {
  text-align: center;
  padding: 40px 0 24px;
}
.tool-hero .tool-icon-lg {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.tool-hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  text-wrap: balance;
}
.tool-hero p {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
  text-wrap: pretty;
}

/* Dropzone */
.workspace { padding: 8px 0 56px; }

.dropzone {
  max-width: 720px;
  margin: 0 auto;
  border: 2px dashed var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 56px 24px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}
.dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.dropzone svg { margin: 0 auto 14px; color: var(--primary); }
.dropzone .dz-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.dropzone .dz-hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 13px 28px;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease;
}
.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-accent {
  background: var(--accent);
  color: #ffffff;
}
.btn-accent:hover { background: #b45309; }

/* File list */
.file-list {
  max-width: 720px;
  margin: 20px auto 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}
.file-item .fi-icon { color: var(--danger); flex-shrink: 0; }
.file-item .fi-name {
  flex: 1;
  font-size: 0.925rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.file-item .fi-size {
  font-size: 0.8rem;
  color: var(--muted);
  flex-shrink: 0;
}
.file-item button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
}
.file-item button:hover { color: var(--danger); background: var(--surface); }

/* Options panel */
.options-panel {
  max-width: 720px;
  margin: 20px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.options-panel h3 { font-size: 1rem; font-weight: 700; }
.opt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.opt-row label { font-weight: 600; font-size: 0.9rem; min-width: 120px; }
.opt-row input[type="text"],
.opt-row input[type="number"],
.opt-row select {
  font-family: inherit;
  font-size: 0.925rem;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  flex: 1;
  min-width: 140px;
}
.opt-row input:focus, .opt-row select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

.action-bar {
  max-width: 720px;
  margin: 24px auto 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Progress + result */
.progress-wrap {
  max-width: 720px;
  margin: 24px auto 0;
  text-align: center;
  display: none;
}
.progress-wrap.visible { display: block; }
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-bar > div {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.2s ease;
}
.progress-label { font-size: 0.9rem; color: var(--muted); }

.result-box {
  max-width: 720px;
  margin: 24px auto 0;
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  border-radius: 14px;
  padding: 28px 24px;
  text-align: center;
  display: none;
}
.result-box.visible { display: block; }
.result-box h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--primary);
}
.result-box p { color: var(--muted); font-size: 0.9rem; margin-bottom: 16px; }

.error-box {
  max-width: 720px;
  margin: 16px auto 0;
  background: #fef2f2;
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  display: none;
  text-align: center;
}
.error-box.visible { display: block; }

/* Page thumbnails (organize / remove pages) */
.pages-grid {
  max-width: 900px;
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.page-thumb {
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 8px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.12s ease;
}
.page-thumb canvas {
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: var(--surface);
}
.page-thumb .pt-num {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 6px;
  display: block;
}
.page-thumb.selected { border-color: var(--danger); }
.page-thumb.selected::after {
  content: "\2715";
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-thumb.pick { border-color: var(--primary); }
.page-thumb.pick::after {
  content: "\2713";
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-thumb.dragging { opacity: 0.4; }

/* ============ Content sections (SEO / AdSense) ============ */
.content-section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}
.content-section .container { max-width: 820px; }
.content-section h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.content-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 22px 0 8px;
}
.content-section p {
  color: var(--muted);
  margin-bottom: 12px;
}
.content-section ol, .content-section ul {
  color: var(--muted);
  padding-inline-start: 22px;
  margin-bottom: 12px;
}
.content-section li { margin-bottom: 6px; }

.page-top {
  border-top: none;
  padding-top: 56px;
}
.page-top h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  text-wrap: balance;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.step-card .step-num {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.step-card h3 { margin: 0 0 6px; font-size: 1rem; }
.step-card p { font-size: 0.875rem; margin: 0; }

/* FAQ */
.faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-item summary {
  padding: 16px 18px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--primary);
  font-weight: 400;
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item .faq-body {
  padding: 0 18px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Features strip */
.features-strip {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 0;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
}
.feature-item { text-align: center; padding: 0 8px; }
.feature-item .f-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-item h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.feature-item p { font-size: 0.875rem; color: var(--muted); }

/* Ad slots (AdSense-ready)
   Hidden by default so visitors never see empty placeholders.
   When you paste your AdSense <ins class="adsbygoogle"> code inside
   an .ad-slot, the slot becomes visible automatically. */
.ad-slot {
  display: none;
  max-width: var(--container);
  margin: 24px auto;
  padding: 0 20px;
  text-align: center;
}
.ad-slot:has(ins.adsbygoogle) { display: block; }
.ad-slot.ad-slot-active { display: block; }
.ad-slot .ad-inner { display: none; }

/* ============ Static pages ============ */
.page-content { padding: 48px 0 64px; }
.page-content .container { max-width: 820px; }
.page-content h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.page-content .page-updated {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 28px;
}
.page-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 30px 0 10px;
}
.page-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 20px 0 8px;
}
.page-content p, .page-content li { color: var(--muted); margin-bottom: 10px; }
.page-content ul, .page-content ol { padding-inline-start: 22px; margin-bottom: 14px; }

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
  margin-top: 24px;
}
.contact-form label { font-weight: 600; font-size: 0.9rem; }
.contact-form input, .contact-form textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  width: 100%;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}
.contact-form textarea { min-height: 140px; resize: vertical; }

/* ============ Footer ============ */
.site-footer {
  background: var(--ink);
  color: #cbd5e1;
  padding: 48px 0 24px;
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 36px;
}
.footer-brand .logo { display: inline-flex; color: #ffffff; margin-bottom: 12px; }
.footer-brand p { font-size: 0.875rem; color: #94a3b8; max-width: 280px; }
.footer-col h4 {
  color: #ffffff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a {
  color: #cbd5e1;
  font-size: 0.9rem;
}
.footer-col a:hover { color: #ffffff; }
.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.825rem;
  color: #94a3b8;
}

/* ============ Responsive ============ */
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px;
    gap: 2px;
    box-shadow: var(--shadow-md);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px; }
  .nav-toggle { display: flex; }
  .hero { padding: 44px 0 36px; }
  .dropzone { padding: 40px 16px; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============ RTL ============ */
html[dir="rtl"] body { font-family: "Tajawal", "Inter", system-ui, sans-serif; }
html[dir="rtl"] .logo { letter-spacing: 0; }
html[dir="rtl"] .hero h1,
html[dir="rtl"] .section-title { letter-spacing: 0; }

/* ============ Tool App (engine UI) ============ */
[hidden] { display: none !important; }

.dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.dz-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 18px;
  letter-spacing: 0.04em;
}
.fi-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.fi-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1;
}
.fi-btn:hover:not(:disabled) { color: var(--primary); background: var(--surface); }
.fi-btn:disabled { opacity: 0.3; cursor: default; }
.fi-btn.fi-del:hover { color: var(--danger); }

.tool-options {
  max-width: 720px;
  margin: 20px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.opts-title { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }
.opts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.opt-field { display: flex; flex-direction: column; gap: 6px; }
.opt-field label { font-weight: 600; font-size: 0.875rem; }
.opt-input {
  font-family: inherit;
  font-size: 0.925rem;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  width: 100%;
}
.opt-input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}
textarea.opt-input { resize: vertical; min-height: 110px; }
.opt-info {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  line-height: 1.5;
}

.tool-actions {
  max-width: 720px;
  margin: 24px auto 0;
  display: flex;
  justify-content: center;
}
.btn-lg { font-size: 1.05rem; padding: 15px 40px; }

.status-host { max-width: 720px; margin: 0 auto; }
.status-box { margin-top: 24px; text-align: center; }
.status-msg { font-size: 0.9rem; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.progress-track {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.result-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: start;
}
.result-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.result-text { font-weight: 700; color: var(--primary); font-size: 0.975rem; margin: 0; }

.error-box:not([hidden]) { display: block; }

.viewer-host {
  max-width: 860px;
  margin: 28px auto 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.reader-page {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  background: #ffffff;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ============ Blog ============ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}
.blog-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.blog-card:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 24px rgba(15, 118, 110, 0.1);
  transform: translateY(-2px);
}
.blog-card h2 {
  font-size: 1.1rem;
  line-height: 1.4;
  margin: 0;
}
.blog-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}
.blog-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(15, 118, 110, 0.08);
  border-radius: 999px;
  padding: 3px 12px;
}
.blog-meta {
  font-size: 0.82rem;
  color: var(--muted);
}
.blog-article .container { max-width: 760px; }
.blog-article h1,
.blog-article .post-h1 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 10px 0 8px;
}
.blog-article .crumbs {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 18px;
}
.blog-article .crumbs a { color: var(--primary); text-decoration: none; }
.blog-article h2 { margin-top: 34px; }
.blog-article h3 { margin-top: 22px; font-size: 1.05rem; }

/* Social share buttons */
.share-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.share-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}
.share-btn {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
  transition: background 0.15s, color 0.15s;
}
.share-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* Related articles */
.related-articles {
  margin-top: 34px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.related-articles h2 { margin-top: 0; font-size: 1.15rem; }
.related-articles ul {
  margin: 10px 0 0;
  padding-inline-start: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.related-articles a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.related-articles a:hover { text-decoration: underline; }

/* HTML sitemap page */
.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px;
}
.sitemap-grid h2 { font-size: 1.05rem; margin-bottom: 10px; }
.sitemap-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.sitemap-grid a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
}
.sitemap-grid a:hover { color: var(--primary); text-decoration: underline; }
.blog-article p, .blog-article li { line-height: 1.7; }
.blog-article ul, .blog-article ol { padding-inline-start: 22px; display: flex; flex-direction: column; gap: 8px; }
.blog-article a { color: var(--primary); }

/* 404 page */
.error-hero {
  text-align: center;
  padding: 80px 20px 60px;
}
.error-hero .code {
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.error-hero h1 { margin: 12px 0 8px; }
.error-hero p { color: var(--muted); max-width: 480px; margin: 0 auto 24px; }

/* ============ Cookie consent banner ============ */
#cookie-consent {
  position: fixed;
  bottom: 16px;
  inset-inline: 16px;
  z-index: 9999;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 20px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
#cookie-consent p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  flex: 1 1 320px;
}
#cookie-consent a { color: var(--primary); text-decoration: underline; }
.consent-actions { display: flex; gap: 8px; flex-shrink: 0; }
.consent-btn {
  font-family: inherit;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
}
.consent-btn:hover { border-color: var(--primary); }
.consent-accept {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.consent-accept:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
