:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --secondary: #8b5cf6;
  --secondary-light: #f5f3ff;
  --accent: #38bdf8;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --error: #dc2626;
  --warning: #d97706;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --focus: 0 0 0 3px rgba(99, 102, 241, 0.35);
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "SF Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", ui-sans-serif, system-ui, sans-serif;
  --header-h: 56px;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

html[data-theme="dark"] {
  --primary: #818cf8;
  --primary-hover: #a5b4fc;
  --primary-light: #1e1b4b;
  --secondary: #a78bfa;
  --secondary-light: #2e1065;
  --accent: #38bdf8;
  --bg: #0b1220;
  --surface: #111827;
  --surface-2: #1e293b;
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #334155;
  --success: #4ade80;
  --error: #f87171;
  --warning: #fbbf24;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --focus: 0 0 0 3px rgba(129, 140, 248, 0.45);
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
code {
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

html[lang="ar"] {
  --font: var(--font-ar);
}
html[lang="ar"] body {
  font-size: 1.0625rem;
  line-height: 1.75;
}
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] .brand {
  letter-spacing: 0;
}
html[lang="ar"] .eyebrow,
html[lang="ar"] .footer-heading {
  letter-spacing: 0.02em;
  text-transform: none;
}

.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -48px;
  background: var(--primary);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 100;
}
.skip-link:focus { top: 12px; color: #fff; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.nav {
  display: none;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}
.nav > a,
.nav-tools summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 10px;
  cursor: pointer;
  list-style: none;
}
.nav > a:hover,
.nav-tools summary:hover,
.nav > a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-tools { position: relative; }
.nav-tools summary::-webkit-details-marker { display: none; }
.nav-panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 0;
  min-width: 220px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
}
.nav-panel a {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.nav-panel a:hover { background: var(--primary-light); }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 700;
}
.lang-switch a {
  color: var(--text-muted);
  text-decoration: none;
}
.lang-switch a[aria-current="true"],
.lang-switch a:hover { color: var(--text); }
.nav-open,
.theme-toggle {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.nav-open-bars {
  display: block;
  width: 16px;
  height: 2px;
  margin: 0 auto;
  background: currentColor;
  border-radius: 2px;
  position: relative;
}
.nav-open-bars::before,
.nav-open-bars::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.nav-open-bars::before { top: -5px; }
.nav-open-bars::after { top: 5px; }
.theme-toggle-icon {
  display: block;
  width: 16px;
  height: 16px;
  margin: 0 auto;
  border-radius: 50%;
  box-shadow: inset 6px -2px 0 0 currentColor;
}
html[data-theme="dark"] .theme-toggle-icon {
  box-shadow: none;
  background: currentColor;
}
.mobile-nav {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 0 20px;
}
.mobile-nav-inner { display: grid; gap: 4px; }
.mobile-nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 4px;
}

.hero {
  padding: 16px 0 12px;
}
.hero-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px 16px 16px;
}
.eyebrow {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}
h1 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 5.4vw, 2.75rem);
  line-height: 1.18;
  letter-spacing: -0.04em;
}
.lede {
  margin: 0 0 16px;
  color: var(--text-secondary);
  max-width: 40rem;
  font-size: 0.98rem;
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.crumbs a { color: var(--text-secondary); text-decoration: none; }
.crumbs a:hover { color: var(--primary); }

.tool-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}
.tool-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tool-input { grid-column: 1 / -1; }
.tool-input,
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  padding: 12px 14px;
}
.contact-form textarea { min-height: 160px; resize: vertical; }
.tool-input:focus,
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus,
.btn:focus-visible,
.theme-toggle:focus-visible,
.nav-open:focus-visible,
.nav a:focus-visible,
.nav-tools summary:focus-visible,
.faq-item summary:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-color: var(--primary);
}
.tool-input.is-valid { border-color: var(--success); }
.tool-input.is-invalid { border-color: var(--error); }
.tool-hint, .tool-status {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.tool-status[data-tone="ok"] { color: var(--success); }
.tool-status[data-tone="bad"] { color: var(--error); }
.tool-status[data-tone="warn"] { color: var(--warning); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.is-busy .btn-label { opacity: 0.7; }

.tool-result {
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.tool-result[hidden] { display: none; }
.tool-result.is-busy,
.tool-result.is-success,
.tool-result.is-unavailable,
.tool-result.is-error,
.tool-result.is-rate {
  display: grid;
  gap: 10px;
}
.tool-result.is-success { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }
.tool-result.is-error { border-color: color-mix(in srgb, var(--error) 35%, var(--border)); }
.tool-result.is-rate,
.tool-result.is-unavailable { border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); }
.result-card {
  display: grid;
  gap: 12px;
}
.result-card img {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  background: var(--surface);
}
.result-title { margin: 0; font-size: 1.05rem; letter-spacing: -0.02em; }
.result-formats { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.result-formats a {
  display: grid;
  gap: 2px;
  min-height: 48px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 700;
}
.result-formats a span {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.86rem;
}
.result-formats a:hover { border-color: var(--primary); color: var(--text); }
.result-formats a.is-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.result-formats a.is-primary span { color: color-mix(in srgb, #fff 80%, var(--primary)); }
.result-formats a.is-primary:hover { color: #fff; filter: brightness(1.05); }
.result-note { color: var(--text-secondary); margin: 0; }
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.section { padding: 48px 0; }
.section h2, .page h2, .prose-section h2 {
  margin: 0 0 12px;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  letter-spacing: -0.03em;
}
.section-lede { color: var(--text-secondary); margin: 0 0 24px; max-width: 40rem; }
.platform-grid, .step-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.platform-card {
  display: grid;
  gap: 4px;
  padding: 18px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  min-height: 88px;
  box-shadow: var(--shadow-sm);
}
.platform-card:hover { border-color: var(--primary); color: inherit; }
.platform-card span { color: var(--text-secondary); font-size: 0.95rem; }
.step-grid li {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.step-num {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}
.step-grid h3 { margin: 12px 0 8px; }
.step-grid p { margin: 0; color: var(--text-secondary); }
.split { display: grid; gap: 24px; }
.plain-list { margin: 0; padding-inline-start: 1.1rem; color: var(--text-secondary); }
.plain-list li + li { margin-top: 8px; }
.why .split {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.prose-wrap { max-width: 720px; }
.prose-section p, .page p { color: var(--text-secondary); }
.prose-section h3, .page h3 { margin-top: 1.6rem; letter-spacing: -0.02em; }
.page { padding: 32px 0 64px; }
.page h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }

.faq-list { display: grid; gap: 10px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 16px;
}
.faq-item summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
}
.faq-item p { color: var(--text-secondary); }

.contact-form { display: grid; gap: 14px; margin-top: 24px; }
.contact-form label { display: grid; gap: 6px; font-weight: 600; color: var(--text); }
.hp { position: absolute; inset-inline-start: -9999px; height: 0; overflow: hidden; }
.tool-input { direction: ltr; text-align: left; unicode-bidi: isolate; }
.banner {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.banner-ok { background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.banner-bad { background: color-mix(in srgb, var(--error) 12%, var(--surface)); }

.error-page { padding: 64px 0; }
.error-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.site-footer {
  margin-top: 24px;
  padding: 40px 0 28px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-grid { display: grid; gap: 28px; }
.footer-lead, .footer-base p { color: var(--text-muted); font-size: 0.92rem; }
.footer-heading {
  margin: 0 0 10px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--text-secondary); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.site-footer a:hover { color: var(--primary); }
.footer-base { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); }

@media (min-width: 640px) {
  .tool-row {
    grid-template-columns: 1fr auto auto;
    align-items: start;
  }
  .platform-grid { grid-template-columns: 1fr 1fr; }
  .step-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (min-width: 880px) {
  :root { --header-h: 64px; }
  .nav { display: flex; }
  .nav-open { display: none; }
  .header-actions { margin-inline-start: 0; }
  .brand img { width: 40px; height: 40px; }
  .hero { padding: 40px 0 24px; }
  .hero-inner { padding: 36px 40px 32px; }
  .lede { font-size: 1.05rem; margin-bottom: 22px; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .split { grid-template-columns: 1.1fr 0.9fr; align-items: center; }
}

@media (min-width: 1280px) {
  .wrap { width: min(1180px, calc(100% - 48px)); }
}
