/* Premium Arabic Design System */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  --primary: #00a693;
  --primary-hover: #008777;
  --secondary: #6366f1;
  --bg-color: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --header-height: 100px;
  --sidebar-width: 260px;
  --scroll-padding: 100px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --prose-max: 70ch;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--scroll-padding);
}

.card[id],
section[id],
h2[id],
h3[id] {
  scroll-margin-top: var(--scroll-padding);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Tajawal', 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.7;
  direction: rtl;
  /* For Arabic */
}

/* Background Gradients */
.background-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 166, 147, 0.1) 0%, rgba(248, 250, 252, 0) 70%);
  z-index: -1;
}

/* Layout */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media (min-width: 1024px) {
  .container {
    max-width: 1100px;
    padding: 0 var(--space-lg);
  }
}

/* Header / primary navigation */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: var(--space-md) 0 var(--space-sm);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-md);
}

.site-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 12px;
  flex-wrap: wrap;
}

.site-nav {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.site-nav-list {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-xs);
  margin: 0;
  padding: 0 var(--space-xs) var(--space-xs);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.site-nav-list li {
  flex: 0 0 auto;
}

.site-nav-list a {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  display: inline-block;
  border: 1px solid transparent;
}

.site-nav-list a:hover {
  color: var(--primary);
  background: rgba(0, 166, 147, 0.08);
}

.site-nav-list a.is-active {
  color: var(--primary);
  background: rgba(0, 166, 147, 0.14);
}

.site-nav-list a.site-nav-legal {
  border: 1px solid var(--border-color);
}

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--surface);
  color: var(--text-main);
  text-decoration: none;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.back-to-top:hover {
  background: rgba(0, 166, 147, 0.08);
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lang-switch {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.lang-switch:hover {
  background: var(--surface);
  border-color: var(--primary);
  color: var(--primary);
}

/* Article layout — sidebar TOC (desktop) */
main.main--no-sidebar .article-prose,
main.main--no-sidebar > .card,
main.main--no-sidebar > .honest-box,
main.main--no-sidebar > .highlight-box {
  max-width: var(--prose-max);
}

main.main--no-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-top: var(--space-lg);
}

.article-prose {
  min-width: 0;
}

.article-prose > .card:first-child,
.article-prose > .honest-box:first-child {
  margin-top: 0;
}

.toc-sidebar {
  min-width: 0;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-lg) var(--space-md);
  margin-bottom: 0;
}

.toc h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.toc ol {
  margin: 0;
  padding-right: 18px;
  line-height: 1.75;
}

html[dir="ltr"] .toc ol {
  padding-right: 0;
  padding-left: 18px;
}

.toc li {
  margin-bottom: var(--space-xs);
}

.toc a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.toc a:hover {
  text-decoration: underline;
}

@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: minmax(220px, var(--sidebar-width)) minmax(0, 1fr);
    align-items: stretch;
    gap: var(--space-2xl);
  }

  .toc-sidebar {
    position: sticky;
    top: var(--scroll-padding);
    max-height: calc(100vh - var(--scroll-padding) - var(--space-lg));
    overflow-y: auto;
    z-index: 5;
  }

  .toc-sidebar .toc {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .article-prose {
    max-width: var(--prose-max);
  }

  :root {
    --scroll-padding: 140px;
    --header-height: 130px;
  }
}

@media (max-width: 640px) {
  .back-to-top {
    bottom: 16px;
    right: 16px;
  }
}

/* Homepage — topic groups & bilingual hub cards */
.home-journey {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 32px auto 0;
  max-width: 680px;
  text-align: right;
}

html[dir="ltr"] .home-journey {
  text-align: left;
}

.home-journey h2 {
  font-size: 1.05rem;
  margin: 0 0 12px;
  color: var(--text-main);
}

.home-journey ol {
  margin: 0;
  padding-right: 22px;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
}

html[dir="ltr"] .home-journey ol {
  padding-right: 0;
  padding-left: 22px;
}

.home-journey a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.home-journey a:hover {
  text-decoration: underline;
}

.home-topic-section {
  margin-top: 48px;
  text-align: right;
}

html[dir="ltr"] .home-topic-section {
  text-align: left;
}

.home-topic-section h2 {
  font-size: 1.35rem;
  margin: 0 0 8px;
}

.home-topic-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 20px;
  max-width: 640px;
}

.home-hub-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hub-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px 28px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.hub-card h3 {
  font-size: 1.28rem;
  margin: 0 0 10px;
  color: var(--text-main);
}

.hub-card p {
  margin: 0 0 16px;
  font-size: 1.05rem;
}

.hub-card-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.hub-card-langs a {
  color: var(--primary);
  text-decoration: none;
}

.hub-card-langs a:hover {
  text-decoration: underline;
}

.hub-card-langs .sep {
  color: var(--border-color);
  font-weight: 400;
}

.hub-card.is-tool {
  border-color: rgba(0, 166, 147, 0.35);
}

.home-main {
  margin-top: var(--space-lg);
}

.home-hero .badge {
  margin-bottom: var(--space-sm);
}

.home-hero {
  text-align: center;
}

.home-hero h1 {
  margin-top: 16px;
}

.home-hero > p {
  max-width: 640px;
  margin: 0 auto 16px;
  font-size: 1.12rem;
  color: var(--text-muted);
}

.note-box {
  background: rgba(99, 102, 241, 0.06);
  border-right: 4px solid var(--secondary);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-sm);
  margin: var(--space-lg) 0;
}

html[dir="ltr"] .note-box {
  border-right: none;
  border-left: 4px solid var(--secondary);
}

footer p {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

footer p + p {
  margin-top: var(--space-xs);
}

.site-footer-link {
  color: var(--text-muted);
  text-decoration: underline;
  font-size: 0.9rem;
}

header:not(.site-header) {
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Typography */
h1 {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
  color: var(--text-main);
}

h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 12px;
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 12px;
}

p {
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Article Specific Formatting */
.article-header {
  text-align: center;
  margin: var(--space-xl) 0 var(--space-lg);
}

.article-header p {
  max-width: var(--prose-max);
  margin-left: auto;
  margin-right: auto;
}

.article-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 30px;
}

.badge {
  background: rgba(0, 166, 147, 0.1);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Cards & Glassmorphism */
.card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 32px;
}

@media (min-width: 769px) and (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
  }

  .home-hub-grid .hub-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
  }
}

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 166, 147, 0.3);
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--primary-hover);
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(0, 166, 147, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--text-muted);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Highlight Box / Alert */
.highlight-box {
  background: rgba(99, 102, 241, 0.05);
  border-right: 4px solid var(--secondary);
  padding: 24px;
  border-radius: 8px;
  margin: 32px 0;
}

.highlight-box h3 {
  margin-top: 0;
  color: var(--secondary);
}

html[dir="ltr"] .highlight-box,
html[dir="ltr"] .honest-box,
html[dir="ltr"] .warning-box {
  border-right: none;
  border-left: 4px solid var(--secondary);
}

html[dir="ltr"] .warning-box {
  border-left-color: #d97706;
}

/* Shared guide components */
.breadcrumb {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
  font-size: 1rem;
}

.comparison-table th {
  background: var(--primary);
  color: white;
  padding: 14px 18px;
  text-align: right;
  font-weight: 700;
}

html[dir="ltr"] .comparison-table th {
  text-align: left;
}

.comparison-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

.comparison-table tr:nth-child(even) td {
  background: #f8fafc;
}

.comparison-table tr:hover td {
  background: rgba(0, 166, 147, 0.05);
}

.check {
  color: #16a34a;
  font-weight: 700;
}

.warn {
  color: #d97706;
  font-weight: 700;
}

.cross {
  color: #dc2626;
  font-weight: 700;
}

.honest-box {
  background: rgba(99, 102, 241, 0.05);
  border-right: 4px solid var(--secondary);
  padding: var(--space-lg);
  border-radius: var(--radius-sm);
  margin: var(--space-xl) 0;
}

.warning-box {
  background: rgba(217, 119, 6, 0.07);
  border-right: 4px solid #d97706;
  padding: 20px var(--space-lg);
  border-radius: var(--radius-sm);
  margin: var(--space-xl) 0;
}

.warning-box strong {
  color: #d97706;
}

.gateway-card {
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  background: var(--surface);
}

.gateway-card h3 {
  margin-top: 0;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.gateway-card .fee-badge {
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.pros-cons {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.pros-cons div {
  flex: 1;
  min-width: 250px;
}

.pros-cons ul {
  padding-right: 20px;
  margin-top: var(--space-xs);
}

html[dir="ltr"] .pros-cons ul {
  padding-right: 0;
  padding-left: 20px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.step-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.step-header h2 {
  margin: 0;
}

.platform-card {
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-bottom: 20px;
  transition: border-color 0.2s;
}

.platform-card.winner {
  border-color: var(--primary);
}

.platform-card .platform-name {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.winner-tag {
  background: var(--primary);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-right: 10px;
  vertical-align: middle;
}

html[dir="ltr"] .winner-tag {
  margin-right: 0;
  margin-left: 10px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: var(--space-lg) 0;
}

@media (max-width: 640px) {
  .info-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.info-item {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 20px;
  border: 1px solid var(--border-color);
}

.info-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-main);
}

.cta-section {
  text-align: center;
  background: linear-gradient(135deg, rgba(0, 166, 147, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(0, 166, 147, 0.2);
  border-radius: var(--radius);
  padding: var(--space-2xl) var(--space-xl);
  margin: 40px 0;
}

.cta-section h2 {
  margin-top: 0;
}

.btn-group {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-lg);
}

.compliance-box {
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-top: var(--space-md);
}

.compliance-box h3 {
  margin-top: 0;
}

.mini-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
}

.mini-card h3 {
  margin-top: 0;
}

.platform-focus {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

@media (min-width: 768px) {
  .platform-focus {
    grid-template-columns: 1fr 1fr;
  }
}

.platform-focus-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-lg);
  background: var(--surface);
}

.pro-item {
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.con-item {
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.company-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  background: var(--surface);
}

.company-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-sm);
}

.company-header h3 {
  margin: 0;
  color: var(--primary);
}

.price-badge,
.details-grid {
  font-size: 0.95rem;
}

.price-badge {
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  color: var(--text-muted);
  line-height: 1.65;
}

@media (min-width: 640px) {
  .details-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
}

.info-table th,
.info-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  text-align: right;
}

html[dir="ltr"] .info-table th,
html[dir="ltr"] .info-table td {
  text-align: left;
}

.info-table th {
  background: #f8fafc;
  font-weight: 700;
}

.disclaimer-card {
  background: var(--surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 40px;
  margin: 40px 0;
}

.disclaimer-card h2 {
  color: var(--text-main);
  margin-top: var(--space-xl);
  font-size: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: var(--space-xs);
}

.disclaimer-card h2:first-of-type {
  margin-top: var(--space-lg);
}

.disclaimer-card p {
  margin-bottom: var(--space-md);
  line-height: 1.8;
}

footer {
  border-top: 1px solid var(--border-color);
  padding: var(--space-xl) 0;
  margin-top: var(--space-2xl);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Calculator page extras */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--text-muted);
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.info-note {
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: var(--space-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

.deemed-note {
  display: none;
  background: rgba(217, 119, 6, 0.08);
  border-right: 4px solid #d97706;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 14px;
  color: #92400e;
}

html[dir="ltr"] .deemed-note {
  border-right: none;
  border-left: 4px solid #d97706;
}

.summary-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.summary-text {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* 404 page */
.error-wrap {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) 0;
}

.error-card {
  max-width: 760px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-xl);
}

.error-code {
  font-size: 3.2rem;
  line-height: 1;
  margin-bottom: var(--space-md);
  font-weight: 800;
  color: var(--primary);
}

.error-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: 20px;
}

.error-card .lang-block {
  margin-top: 28px;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.error-card .lang-block[lang="ar"] {
  direction: rtl;
  text-align: right;
}

.error-card .lang-block h2 {
  margin-top: 0;
  margin-bottom: 10px;
}

/* Sitewide affiliate hub (injected before footer) */
.affiliate-hub {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin: 48px 0 32px;
  box-shadow: var(--shadow-sm);
}

.affiliate-hub-title {
  font-size: 1.35rem;
  margin: 0 0 12px;
  color: var(--text-main);
}

.affiliate-hub-support {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.65;
}

.affiliate-hub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .affiliate-hub-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.affiliate-hub-card {
  background: rgba(0, 166, 147, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

html[dir="ltr"] .affiliate-hub-card {
  background: rgba(99, 102, 241, 0.04);
}

.affiliate-hub-card-name {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-main);
}

.affiliate-hub-promo {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(0, 166, 147, 0.1);
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  align-self: flex-start;
}

.affiliate-hub-card-blurb {
  margin: 0;
  flex: 1;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.affiliate-hub-cta {
  margin-top: 8px;
  width: 100%;
  justify-content: center;
  text-align: center;
}

.affiliate-hub-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

.affiliate-hub-meta a {
  color: var(--primary);
  text-decoration: underline;
}

.affiliate-hub-meta a:hover {
  color: var(--primary-hover);
}

/* Specific Hostinger/Salla Blocks */
.promo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(135deg, var(--surface) 0%, rgba(0, 166, 147, 0.05) 100%);
  padding: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  margin: 40px 0;
}

/* ─── Mobile-First Responsive ────────────────────────────── */

/* Make all tables horizontally scrollable on small screens */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px -8px;
  padding: 0 8px;
}

/* Subtle gradient fade on the right edge to hint "swipe →" */
.table-wrap::after {
  content: '';
  position: sticky;
  right: 0;
  display: block;
  width: 32px;
  height: 100%;
  pointer-events: none;
}

/* Prevent table cells from collapsing to nothing */
.table-wrap table {
  min-width: 540px;
}

@media (max-width: 768px) {

  /* Header */
  header.site-header {
    padding: 16px 0 10px;
  }

  header:not(.site-header) {
    padding: 16px 0;
  }

  .logo {
    font-size: 1.2rem;
  }

  /* Cards — no hover lift on touch devices, tighter padding */
  .card {
    padding: 20px 16px;
    margin-bottom: 24px;
  }

  .card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  /* Article meta badges — wrap to multiple lines */
  .article-meta {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
  }

  /* Buttons — full width on mobile for fat-finger friendliness */
  .btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
  }

  /* Step headers */
  .step-header {
    gap: 12px;
  }

  .step-badge {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  /* Info grids — always stack on mobile */
  .info-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .info-item {
    padding: 16px;
  }

  /* Platform cards */
  .platform-card {
    padding: 18px 16px;
  }

  /* Highlight / warning boxes */
  .highlight-box {
    padding: 18px 16px;
    margin: 24px 0;
  }

  .warning-box {
    padding: 16px;
  }

  /* Promo block */
  .promo-block {
    padding: 28px 16px;
  }

  /* CTA section */
  .cta-section {
    padding: 32px 16px;
  }

  .btn-group {
    flex-direction: column;
    gap: 12px;
  }

  /* Table of contents */
  .toc {
    padding: 20px 16px;
  }

  /* Guides grid on index page — always stack */
  .guides-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }

  .site-header-row {
    flex-wrap: nowrap;
  }

  .site-nav-list {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 0;
  }

  html[dir="rtl"] .site-nav-list {
    justify-content: flex-end;
  }

  .site-nav-list a {
    font-size: 0.9rem;
  }

  h1 {
    font-size: 2.8rem;
    line-height: 1.2;
    margin-bottom: 24px;
  }

  h2 {
    font-size: 1.8rem;
    margin-top: 48px;
    margin-bottom: 16px;
  }

  h3 {
    font-size: 1.4rem;
    margin-top: 32px;
  }

  p {
    font-size: 1.0625rem;
    margin-bottom: 20px;
    line-height: 1.75;
  }

  .article-header {
    margin: var(--space-2xl) 0 var(--space-xl);
  }
}

/* ─── Calculator Styles ────────────────────────────── */
.calc-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
@media (min-width: 768px) {
  .calc-container { flex-direction: row; }
  .calc-form { flex: 2; }
  .calc-results {
    flex: 1;
    position: sticky;
    top: var(--scroll-padding);
    align-self: flex-start;
  }
}

.calc-section {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.calc-section h3 {
  margin-top: 0;
  color: var(--primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.form-group select, .form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-body);
  color: var(--text-main);
  font-size: 1rem;
}

.form-group select:focus, .form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 166, 147, 0.2);
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.range-wrap input[type=range] {
  flex: 1;
}

.range-value {
  font-weight: 700;
  color: var(--primary);
  min-width: 80px;
  text-align: left;
}

.calc-results {
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0, 166, 147, 0.15);
}

.calc-results h3 {
  margin-top: 0;
  text-align: center;
  color: var(--text-main);
}

.result-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border-color);
}

.result-total {
  display: flex;
  justify-content: space-between;
  padding: 16px 0 0;
  margin-top: 16px;
  border-top: 2px solid var(--border-color);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
}

.btn-calc {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 24px;
  padding: 14px;
  font-size: 1.1rem;
}