/* ══════════════════════════════════════════════════════════════
   أرى الدليل — Main Stylesheet  (RTL Arabic Editorial Platform)
   ══════════════════════════════════════════════════════════════ */

/* ── Custom Fonts ── */
@font-face {
  font-family: 'Aligarh';
  src: url('../fonts/aligarh-arabic.otf') format('opentype');
  font-weight: normal; font-style: normal; font-display: swap;
}
/* ── Local Arabic fonts ── */
@font-face {
  font-family: 'AlJazeera';
  src: url('../fonts/ArbFONTS-Al-Jazeera-Arabic-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'AlJazeeraBold';
  src: url('../fonts/ArbFONTS-Al-Jazeera-Arabic-Bold-1.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'AlJazeeraLight';
  src: url('../fonts/ArbFONTS-Al-Jazeera-Arabic-Light.ttf') format('truetype');
  font-weight: 300; font-style: normal; font-display: swap;
}

/* ── Quill font classes — must exist in main.css so articles render fonts correctly ── */
/* Without these, Quill's ql-font-* classes have no CSS and all text falls back to default */
.ql-font-cairo        { font-family: 'Cairo', sans-serif !important; }
.ql-font-cairo-bold   { font-family: 'Cairo', sans-serif !important; font-weight: 700 !important; }
.ql-font-tajawal-bold { font-family: 'Tajawal', sans-serif !important; font-weight: 700 !important; }
.ql-font-amiri        { font-family: 'Amiri', serif !important; }
.ql-font-ibm-plex     { font-family: 'IBM Plex Sans Arabic', sans-serif !important; }
.ql-font-serif          { font-family: Georgia, serif !important; }
.ql-font-monospace      { font-family: 'Courier New', monospace !important; }
.ql-font-jazeera        { font-family: 'AlJazeera', sans-serif !important; }
.ql-font-jazeera-bold   { font-family: 'AlJazeeraBold', 'AlJazeera', sans-serif !important; font-weight: 700 !important; }
.ql-font-jazeera-light  { font-family: 'AlJazeeraLight', 'AlJazeera', sans-serif !important; font-weight: 300 !important; }

/* ── CSS Variables ── */
:root {
  --bg:      #05060a;
  --surface: #0d0f14;
  --card:    #111520;
  --soft:    #191d28;
  --border:  rgba(255,255,255,.07);
  --text:    #f0f0f0;
  --muted:   #9aa3b0;
  --subtle:  #636b78;
  --accent:  #c8a94d;
  --accent2: #dfc27a;
  --danger:  #e55;
  --radius:  10px;   /* modern rounded corners */
  --shadow:  0 4px 24px rgba(0,0,0,.45);
  --font:    'IBM Plex Sans Arabic', system-ui, sans-serif;
}

body.light {
  --bg:      #f5f2ec;
  --surface: #ffffff;
  --card:    #ffffff;
  --soft:    #ede9e0;
  --border:  rgba(0,0,0,.10);
  --text:    #111111;
  --muted:   #555e6e;
  --subtle:  #8a929e;
  --shadow:  0 4px 24px rgba(0,0,0,.10);
}

/* ── Light mode fixes ────────────────────────────────────────────────────────

   Problem 1: overlay cards (image cards with gradient)
   The card body text inherits color:var(--text) = #111 in light mode.
   But these cards have a DARK image + gradient behind them, so text must
   stay WHITE regardless of theme.

   Problem 2: gold accent (#c8a94d) as TEXT on white background fails
   WCAG AA contrast. Use a darker shade only where it's text on white/cream.
   We do NOT change --accent itself so buttons/icons stay gold.            */

/* 1. Force white text on ALL overlay card content in light mode */
body.light .card-body-overlay,
body.light .card-body-overlay .cat-badge,
body.light .card-body-overlay .card-title,
body.light .card-body-overlay .card-title.large,
body.light .card-body-overlay .card-excerpt,
body.light .card-body-overlay .card-meta,
body.light .card-body-overlay h2,
body.light .card-body-overlay h3,
body.light .card-body-overlay p,
body.light .card-body-overlay span,
body.light .card-body-overlay i {
  color: #ffffff !important;
}

/* 2. Gold-on-white: only override text colour, not the variable */
body.light .cat-badge       { color: #7d5c14; }
body.light .cat-tag         { color: #7d5c14; background: rgba(125,92,20,.10); }
body.light .section-head .see-all         { color: #7d5c14; }
body.light .section-head .see-all:hover   { color: #5a4010; }
body.light .site-nav a:hover,
body.light .site-nav a.active             { color: #7d5c14; }
body.light .site-nav a.active::after      { background: #7d5c14; }
body.light .section-head::before          { background: #7d5c14; }
body.light .fallacy-nav a:hover           { color: #7d5c14; }
body.light .filter-btn.active,
body.light .filter-btn:hover { background: #7d5c14; border-color: #7d5c14; color: #fff; }

/* Restore gold for cat-badges that ARE on overlay cards (dark image bg) */
body.light .card-body-overlay .cat-badge { color: #c8a94d !important; }

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  /* Match body background so iOS overscroll shows page colour, not black */
  background: #05060a; /* synced by JS on theme toggle */
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
  transition: background .25s, color .25s;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; height: auto; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; }

/* ── Critical: every grid / flex child must be able to shrink below content size ──
   Without min-width:0, a grid item expands to hold its content even if it overflows
   the track — the most common cause of "text cut off on right" in RTL grid layouts. */
.hero-grid > *, .cards-grid > *, .cards-grid-4 > *,
.listing-grid > *, .footer-grid > *, .hero-side > *,
.content-sidebar > *, .article-layout > *, .fallacy-content-grid > *,
.footer-col, .sidebar-widget, .sidebar-post { min-width: 0; }

.page-content {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ── Layout ── */
.container {
  width: min(1380px, calc(100% - 40px));
  margin-inline: auto;
}

.page-content { min-height: 0; } /* removed 60vh — was creating dark empty space on mobile */

/* ── Site Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(5,6,10,.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background .25s;
}
body.light .site-header {
  background: rgba(255,255,255,.97);
}

.topbar {
  min-height: 80px;
  height: auto;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  width: 48px; height: 48px;
  background: var(--accent);
  color: #000;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.brand-logo {
  /* width/height set via inline style from PHP logo_size setting */
  max-width: clamp(40px, 15vw, 120px); /* never overflow on any screen */
  max-height: clamp(40px, 15vw, 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 8px rgba(200,169,77,.25));
}
body.light .brand-logo {
  mix-blend-mode: multiply;
  filter: invert(1) drop-shadow(0 0 6px rgba(0,0,0,.15));
}
.brand-name {
  font-family: 'Aligarh', var(--font);
  font-size: clamp(1.2rem, 2.8vw, 1.7rem);
  font-weight: normal; /* Aligarh is already bold by design */
  letter-spacing: .01em;
  white-space: nowrap;
}

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

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--soft);
  border: 1px solid var(--border);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: .95rem;
  transition: background .2s, border-color .2s;
}
.icon-btn:hover { background: var(--accent); border-color: var(--accent); color: #000; }

.mobile-menu-btn { display: none; }

.nav-wrap {
  border-top: none;
  background: var(--surface);
}
/* On desktop, always show nav-wrap (it's the only header bar) */
@media (min-width: 601px) {
  .nav-wrap      { display: flex !important; align-items: center; }
  .mobile-topbar { display: none !important; }
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  min-height: 52px;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  padding: 14px 18px;
  font-size: .95rem;
  font-weight: 700;
  font-family: var(--nav-font, var(--font));
  white-space: nowrap;
  color: var(--muted);
  transition: color .2s;
  position: relative;
}
.site-nav a:hover, .site-nav a.active { color: var(--accent); }
.site-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 18px; right: 18px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ── Section Headings ── */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
  position: relative;
}
.section-head::before {
  content: '';
  position: absolute;
  bottom: -2px; right: 0;
  width: 60px; height: 2px;
  background: var(--accent);
}
.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
}
.section-head .see-all {
  font-size: .9rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.section-head .see-all:hover { text-decoration: underline; }

/* ── Article Card ── */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
  border-radius: var(--radius);
  transition: transform .25s ease, border-color .25s, box-shadow .25s;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(200,169,77,.4);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
}

.card-thumb {
  position: relative;
  overflow: hidden;
}
.card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.card:hover .card-thumb img { transform: scale(1.04); }

/* Overlay gradient cards (hero style) */
.card-overlay {
  position: absolute;
  inset: 0;
  /* Stronger gradient ensures white text is readable on ANY image brightness */
  background: linear-gradient(
    transparent 15%,
    rgba(0,0,0,.45) 45%,
    rgba(0,0,0,.92) 100%
  );
}
.card-body-overlay {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  padding: 24px 22px 20px;
}
/* Text-shadow makes overlay text readable on both dark and bright images */
.card-body-overlay .cat-badge,
.card-body-overlay .card-title,
.card-body-overlay .card-excerpt,
.card-body-overlay .card-meta,
.card-body-overlay h2,
.card-body-overlay h3,
.card-body-overlay p {
  text-shadow: 0 1px 4px rgba(0,0,0,.9), 0 2px 10px rgba(0,0,0,.7);
}

/* Standard cards */
.card-body {
  padding: 20px;
}

.cat-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 10px;
  background: rgba(200,169,77,.12);
  border-radius: 20px;
}
/* Overlay cards: badge as a floating label on the image */
.card-body-overlay .cat-badge {
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(200,169,77,.3);
  font-size: .7rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--article-title-font, var(--font));
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 8px;
}
.card-overlay .card-title { color: #fff; font-size: 1.3rem; }
.card-title.large { font-size: clamp(1.5rem, 3vw, 2.2rem); }

.card-excerpt {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-overlay .card-excerpt { color: #cdd0d7; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: .82rem;
  color: var(--subtle);
  flex-wrap: wrap;
}
.card-meta i { color: var(--accent); }

/* ── Grid Layouts ── */
.hero-section { padding: 48px 0; border-bottom: 1px solid var(--border); }

.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}
.hero-side { display: grid; gap: 24px; }

.card-hero { height: 520px; }
.card-hero .card-thumb { height: 100%; }
.card-hero .card-title { font-size: clamp(1.6rem, 2.5vw, 2.4rem); }

.card-medium { height: 246px; }
.card-medium .card-thumb { height: 100%; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.cards-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.card-standard .card-thumb { height: 200px; }

/* ── Standard Section ── */
.section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}

/* ── Sidebar Layout ── */
.content-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

.sidebar-widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 28px;
}
.sidebar-widget h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-post {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.sidebar-post:last-child { border-bottom: none; }
.sidebar-post-thumb {
  width: 72px; height: 60px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}
.sidebar-post-title {
  font-size: .9rem;
  font-weight: 700;
  font-family: var(--article-title-font, var(--font));
  line-height: 1.45;
}
.sidebar-post-meta {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Article Page ── */
.article-hero { padding: 40px 0 0; }
.article-header { max-width: 820px; }
.article-category { margin-bottom: 12px; font-size: .9rem; font-weight: 800; color: var(--accent); }
.article-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  font-family: var(--article-title-font, var(--font));
  line-height: 1.3;
  margin-bottom: 20px;
}
.article-excerpt {
  font-size: 1.15rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 24px;
  max-width: 700px;
}
.article-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
  font-size: .88rem;
  color: var(--muted);
}
.article-meta-bar i { color: var(--accent); }

.article-cover {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 48px;
}

/* ── Article Content Typography ── */
.article-content {
  font-size: 1.1rem;
  line-height: 2;
  max-width: 780px;
  color: var(--text);
}
.article-content h2 {
  font-size: 1.7rem;
  font-weight: 800;
  margin: 48px 0 20px;
  padding-right: 16px;
  border-right: 4px solid var(--accent);
}
.article-content h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 36px 0 16px;
  color: var(--accent2);
}
.article-content p { margin-bottom: 24px; }
.article-content blockquote {
  background: var(--soft);
  border-right: 4px solid var(--accent);
  padding: 20px 24px;
  margin: 32px 0;
  border-radius: var(--radius);
  color: var(--muted);
  font-style: italic;
}
.article-content ul, .article-content ol {
  padding-right: 28px;
  margin-bottom: 24px;
}
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 10px; }
.article-content a { color: var(--accent); text-decoration: underline; }
.article-content img {
  width: 100%;
  border-radius: var(--radius);
  margin: 28px 0;
}
.article-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* ── Author Box ── */
.author-box {
  display: flex;
  gap: 20px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 48px;
}
.author-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--card);
  border: 2px solid var(--border);
}
.author-avatar-placeholder {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 800;
  flex-shrink: 0;
}
.author-name { font-size: 1rem; font-weight: 800; margin-bottom: 6px; }
.author-bio  { font-size: .9rem; color: var(--muted); }

/* ── Related Posts ── */
.related-section { padding: 48px 0; }

/* ── Listing Page ── */
.listing-header { padding: 48px 0 0; }
.listing-header h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; margin-bottom: 8px; }
.listing-header p { color: var(--muted); font-size: 1rem; }

.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 40px 0;
}

/* ── Search ── */
.search-hero {
  padding: 56px 0;
  text-align: center;
}
.search-hero h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 24px; }

.search-form {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
  border: 2px solid var(--border);
  border-radius: 40px;
  overflow: hidden;
  background: var(--card);
  transition: border-color .2s;
}
.search-form:focus-within { border-color: var(--accent); }
.search-form input {
  flex: 1;
  padding: 14px 22px;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  direction: rtl;
}
.search-form button {
  padding: 0 24px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-family: var(--font);
  font-size: .95rem;
  border-radius: 0 40px 40px 0;
}

/* ── About & Contact Pages ── */
.static-page { padding: 56px 0; }
.static-page .inner { max-width: 800px; }
.static-page h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 16px; }
.static-page p { font-size: 1.05rem; color: var(--muted); margin-bottom: 20px; line-height: 1.9; }

.contact-form {
  max-width: 680px;
  margin-top: 32px;
}
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: .9rem; font-weight: 700; margin-bottom: 8px; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 13px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: .95rem;
  direction: rtl;
  outline: none;
  transition: border-color .2s;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { min-height: 150px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.btn-primary { background: var(--accent); color: #000; border: 2px solid var(--accent); }
.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); }
.btn-outline { background: transparent; color: var(--text); border: 2px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ── Pagination ── */
.pagination { padding: 32px 0; display: flex; justify-content: center; }
.pagination ul { display: flex; gap: 8px; }
.pagination li a {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: .9rem;
  font-weight: 700;
  transition: all .2s;
}
.pagination li.active a,
.pagination li a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

/* ── Category Badge ── */
.cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 800;
  background: rgba(200,169,77,.12);
  color: var(--accent);
  margin-bottom: 12px;
}

/* ── Flash / Alert ── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.alert-success { background: rgba(39,174,96,.15); border: 1px solid rgba(39,174,96,.3); color: #2ecc71; }
.alert-error   { background: rgba(231,76,60,.15);  border: 1px solid rgba(231,76,60,.3);  color: #e74c3c; }

/* ══════════════════════════════════════════════════════════
   FOOTER  .sf — editorial dark footer, mobile-first
   ══════════════════════════════════════════════════════════ */

/* ── Base ── */
.sf { background: var(--surface); border-top: 1px solid var(--border); margin-top: 48px; }

/* ── Brand band ── */
.sf-brand-band { padding: 36px 0; border-bottom: 1px solid var(--border); }
.sf-brand-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.sf-brand-text  { display: flex; flex-direction: column; gap: 5px; }
.sf-name        { font-size: 1.25rem; font-weight: 800; }
.sf-tagline     { font-size: .83rem; color: var(--muted); max-width: 360px; line-height: 1.6; }

/* Social icons */
.sf-social { display: flex; flex-wrap: wrap; gap: 8px; }
.sf-ico {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--soft); border: 1px solid var(--border);
  color: var(--muted); display: grid; place-items: center;
  font-size: .88rem; transition: all .2s;
}
.sf-ico:hover { background: var(--ic, var(--accent)); border-color: var(--ic, var(--accent)); color: #fff; }

/* ── Links band ── */
.sf-links-band  { padding: 32px 0; border-bottom: 1px solid var(--border); }
.sf-links-inner { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 40px; }

.sf-nav-block h6, .sf-support-block h6 {
  font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--accent);
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.sf-nav-items { display: flex; flex-direction: column; gap: 10px; }
.sf-nav-items a { font-size: .87rem; color: var(--muted); display: flex; align-items: center; gap: 7px; transition: color .2s; }
.sf-nav-items a:hover { color: var(--text); }
.sf-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.sf-support-block p { font-size: .8rem; color: var(--subtle); line-height: 1.6; margin-bottom: 14px; }
.sf-support-btn {
  display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700;
  padding: 10px 18px; border-radius: 8px; margin-bottom: 8px;
  transition: all .2s; width: fit-content;
}
.sf-patreon { background: rgba(255,66,77,.12); color: #ff424d; border: 1px solid rgba(255,66,77,.25); }
.sf-patreon:hover { background: #ff424d; color: #fff; }
.sf-paypal  { background: rgba(0,112,186,.12); color: #0070ba; border: 1px solid rgba(0,112,186,.25); }
.sf-paypal:hover  { background: #0070ba; color: #fff; }

/* ── Bottom bar ── */
.sf-bottom { padding: 14px 0; }
.sf-bottom-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sf-bottom-inner span { color: var(--subtle); font-size: .79rem; }
.sf-bottom-inner a    { color: var(--subtle); font-size: .79rem; transition: color .2s; }
.sf-bottom-inner a:hover { color: var(--accent); }

/* Legacy compat */
.footer-links li { margin-bottom: 10px; }
.footer-links a  { color: var(--muted); font-size: .9rem; transition: color .2s; }
.footer-links a:hover { color: var(--accent); }
.social-links { display: flex; flex-wrap: wrap; gap: 10px; }
.social-link { width: 38px; height: 38px; border-radius: 50%; background: var(--soft); border: 1px solid var(--border); color: var(--muted); display: grid; place-items: center; font-size: .9rem; transition: all .2s; }
.social-link:hover { background: var(--accent); border-color: var(--accent); color: #000; }
.footer-bottom { border-top: 1px solid var(--border); padding: 20px 0; text-align: center; color: var(--subtle); font-size: .85rem; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 16px; color: var(--subtle); display: block; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; }

/* ── Page Hero Banner ── */
.page-banner {
  background: var(--soft);
  border-bottom: 1px solid var(--border);
  padding: 48px 0;
  margin-bottom: 40px;
}
.page-banner h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; }
.page-banner p  { color: var(--muted); margin-top: 8px; font-size: 1rem; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--subtle); }

/* ── Reading Progress Bar ── */
#readingProgress {
  position: fixed;
  top: 0; right: 0; left: 0;
  height: 3px;
  background: var(--accent);
  transform-origin: right;
  transform: scaleX(0);
  z-index: 9999;
  transition: transform .1s linear;
}

/* ── Table of contents ── */
.toc {
  background: var(--soft);
  border: 1px solid var(--border);
  border-right: 3px solid var(--accent);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 36px;
}
.toc-title { font-weight: 800; margin-bottom: 12px; font-size: .95rem; }
.toc ul { padding-right: 20px; list-style: disc; }
.toc li { margin-bottom: 6px; }
.toc a  { color: var(--muted); font-size: .9rem; transition: color .2s; }
.toc a:hover { color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile-first breakpoints
   ══════════════════════════════════════════════════════════ */

/* ── ≤ 1100px (small desktop / large tablet) ── */
/* ── Header layout ── */
/* Mobile-only bar: hidden on desktop, shown on mobile via !important */
.mobile-topbar { display: none; }

@media (max-width: 1100px) {
  .hero-grid       { grid-template-columns: 1fr; }
  .card-hero       { height: 440px; }
  .hero-side       { grid-template-columns: 1fr 1fr; }
  .footer-grid     { grid-template-columns: 1fr 1fr; }
  .content-sidebar { grid-template-columns: 1fr; }
  .sidebar         { order: -1; }
}

/* ── ≤ 800px (tablet) ── */
@media (max-width: 800px) {
  .cards-grid   { grid-template-columns: 1fr 1fr; }
  .cards-grid-4 { grid-template-columns: 1fr 1fr; }
  .listing-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid  { grid-template-columns: 1fr; gap: 28px; }
  .hero-side    { grid-template-columns: 1fr; }

  .section           { padding: 40px 0; }
  .hero-section      { padding: 32px 0; }
  .section-head h2   { font-size: 1.6rem; }
  .page-banner       { padding: 32px 0; }
  .page-banner h1    { font-size: 1.6rem; }
}

/* ── ≤ 600px (mobile) ── */
@media (max-width: 600px) {
  .container    { width: calc(100% - 24px); }

  /* Navigation */
  .mobile-menu-btn    { display: grid; }
  .nav-wrap           { display: none; }
  .nav-wrap.open      { display: block; }
  /* mobile-topbar hidden on mobile — bottom nav replaces it */
  .mobile-topbar      { display: none !important; }
  .desktop-brand      { display: none !important; }
  .topbar-btns-mobile { display: none !important; }
  .site-nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 4px 0;
    max-height: 80vh;
    overflow-y: auto;
  }
  .site-nav a {
    padding: 13px 16px;
    width: 100%;
    border-bottom: 1px solid var(--border);
    font-size: .92rem;
  }

  /* Grid collapses to 1 column */
  .cards-grid   { grid-template-columns: 1fr; }
  .cards-grid-4 { grid-template-columns: 1fr; }
  .listing-grid { grid-template-columns: 1fr; }

  /* Cards */
  .card-hero            { height: 300px; }
  .card-medium          { height: 200px; }
  .card-standard .card-thumb { height: 180px; }
  .card-body            { padding: 14px; }
  .card-title           { font-size: 1rem; }
  .card-overlay .card-title { font-size: 1.1rem; }

  /* Sections */
  .section      { padding: 28px 0; }
  .hero-section { padding: 20px 0; }
  .section-head { flex-direction: row; flex-wrap: wrap; margin-bottom: 18px; }
  .section-head h2 { font-size: 1.4rem; }

  /* Article */
  .article-hero           { padding: 24px 0 0; }
  .article-title          { font-size: 1.5rem !important; }
  .article-excerpt        { font-size: 1rem; }
  .article-meta-bar       { gap: 10px; font-size: .8rem; flex-wrap: wrap; }
  .article-meta-bar .share-btns {
    margin-right: 0 !important;
    width: 100%;
    margin-top: 4px;
  }
  .article-content        { font-size: 1rem; }
  .article-content h2     { font-size: 1.25rem; }
  .article-content h3     { font-size: 1.1rem; }
  .article-content blockquote { padding: 14px 16px; }
  .author-box             { flex-direction: column; }

  /* Page banner */
  .page-banner    { padding: 24px 0; }
  .page-banner h1 { font-size: 1.5rem; }

  /* Search */
  .search-hero    { padding: 32px 0; }
  .search-hero h1 { font-size: 1.5rem; }
  .search-form    { max-width: 100%; }

  /* Footer */
  .footer-grid    { gap: 20px; padding: 32px 0; }

  /* Breadcrumb */
  .breadcrumb { flex-wrap: wrap; font-size: .8rem; }
}

/* ── ≤ 480px (small phones) ── */
@media (max-width: 480px) {
  html { font-size: 15px; }
  .container { width: calc(100% - 20px); }

  /* Header */
  .topbar     { min-height: 60px; padding: 6px 0; gap: 8px; }
  .brand-name { font-size: 1rem !important; }
  .brand-logo { max-width: 44px !important; max-height: 44px !important; }
  .icon-btn   { width: 36px; height: 36px; font-size: .85rem; }
  .header-actions { gap: 5px; }

  /* Cards */
  .card-hero   { height: 240px; }
  .card-medium { height: 180px; }

  /* Article */
  .article-title       { font-size: 1.3rem !important; }
  .article-content     { font-size: .97rem; }
  .article-cover       { max-height: 240px; margin-bottom: 24px; }

  /* Footer */
  .footer-bottom { font-size: .78rem; padding: 16px 0; }

  /* Pagination wrap */
  .pagination ul { flex-wrap: wrap; justify-content: center; gap: 4px; }

  /* Related grid */
  .related-grid { grid-template-columns: 1fr !important; }
}

/* ── ≤ 380px (very small phones) ── */
@media (max-width: 380px) {
  .topbar   { gap: 6px; }
  .brand-name { display: none; } /* hide text, keep only logo on tiny screens */
  .card-hero { height: 210px; }
  .section-head h2 { font-size: 1.25rem; }
}

/* ── Content overflow guards ─────────────────────────────────── */
.article-content {
  /* Contain the column — nothing inside can escape this box */
  overflow: hidden;
  max-width: 100%;
}

.article-content,
.article-content * {
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

/* Images — !important overrides any inline width from Quill */
.article-content img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: block;
}

/* Pre/code scroll horizontally — never push the column wider */
.article-content pre {
  overflow-x: auto;
  white-space: pre;
  max-width: 100%;
}

/* Tables scroll horizontally */
.article-content table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

/* Card text */
.card-title, .card-excerpt, .sidebar-post-title {
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* Card thumb images */
.card-thumb img {
  max-width: 100%;
  height: auto;
}

/* ── Back-to-top button ─────────────────────────────────── */
#backToTop {
  position: fixed;
  bottom: 24px;
  left: 20px;   /* RTL: left side of screen */
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 4px 18px rgba(0,0,0,.35);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .25s, transform .25s;
  display: flex;
  align-items: center;
  justify-content: center;
}
#backToTop.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#backToTop:hover { background: var(--accent2); }

/* ══════════════════════════════════════════════════════════
   MOBILE DESIGN IMPROVEMENTS (inspired by modern Arabic editorial apps)
   ══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════
   MOBILE DESIGN — Clean, readable editorial layout
   ═══════════════════════════════════════════════════════ */
@media (max-width: 600px) {

  /* ── Container ── */
  .container { width: calc(100% - 20px); }

  /* ── Section spacing — more breathing room between sections ── */
  .section        { padding: 28px 0; }
  .hero-section   { padding: 16px 0; }

  /* ── Section heads — clean pill-style label ── */
  .section-head {
    padding-bottom: 0;
    margin-bottom: 16px;
    border-bottom: none;
    position: relative;
    align-items: center;
  }
  .section-head::before { display: none; }
  .section-head h2 {
    font-size: 1.05rem;
    font-weight: 800;
    padding-right: 12px;
    border-right: 3px solid var(--accent);
  }
  .section-head .see-all {
    font-size: .78rem;
    padding: 4px 10px;
    border: 1px solid var(--accent);
    border-radius: 20px;
    color: var(--accent);
  }

  /* ── Grids: 2 columns on mobile ── */
  .cards-grid   { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .cards-grid-4 { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .listing-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }

  /* ── Card design — cleaner and more readable ── */
  .card { border-radius: 12px; }
  .card-body { padding: 10px 11px 12px; }
  .card-title {
    font-size: .88rem;
    line-height: 1.45;
    -webkit-line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .card-excerpt { display: none; }
  .card-meta { font-size: .72rem; gap: 6px; margin-top: 6px; }
  .cat-badge { font-size: .64rem; padding: 2px 7px; margin-bottom: 5px; letter-spacing: .02em; }

  /* ── 16:9 thumbnail ratio — consistent and clean ── */
  .card-standard .card-thumb {
    height: 0;
    padding-bottom: 58%;
    position: relative;
  }
  .card-standard .card-thumb img {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
  }

  /* ── Hero section — full-width single card + 2 below ── */
  .hero-grid    { gap: 10px; }
  .hero-side    { gap: 10px; }
  .card-hero    { height: 240px; border-radius: 12px; }
  .card-medium  { height: 160px; border-radius: 12px; }
  .card-body-overlay { padding: 14px 12px 12px; }
  .card-body-overlay .card-title { font-size: .95rem; }
  .card-body-overlay .card-title.large { font-size: 1.1rem; }
  .card-body-overlay .card-excerpt { display: none; }
  .card-body-overlay .card-meta { font-size: .7rem; gap: 6px; }

  /* ── Page banner ── */
  .page-banner { padding: 20px 0; }
  .page-banner h1 { font-size: 1.3rem; }

  /* ── Fallacy grid ── */
  .fallacy-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .fallacy-card-item { padding: 12px 10px; border-radius: 12px; }
  .fallacy-icon { width: 40px; height: 40px; font-size: 1.5rem; margin-bottom: 8px; border-radius: 10px; }
  .fallacy-title { font-size: .88rem; }
  .fallacy-summary { font-size: .76rem; }

  /* ── Related posts ── */
  .related-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }

  /* ── Remove hover transforms on touch ── */
  .card:hover { transform: none; box-shadow: 0 2px 12px rgba(0,0,0,.18); }
  .card:active { transform: scale(.97); transition: transform .1s; box-shadow: none; }

  /* ── Search ── */
  .search-hero { padding: 24px 0; }
  .search-hero h1 { font-size: 1.25rem; }
}

/* ── Very small phones (≤ 380px) ── */
@media (max-width: 380px) {
  .cards-grid, .cards-grid-4, .listing-grid, .fallacy-grid {
    grid-template-columns: 1fr !important;
  }
  .card-title { font-size: .85rem; }
}

/* ── Very small phones (≤ 380px): single column ── */
@media (max-width: 380px) {
  .cards-grid, .cards-grid-4, .listing-grid, .fallacy-grid {
    grid-template-columns: 1fr !important;
  }
  .card-standard .card-thumb { padding-bottom: 52%; }
}

/* ── Mobile listing: compact list view for articles page ── */
@media (max-width: 600px) {
  /* Article listing — 2-col image cards */
  .listing-grid .card-standard .card-title { font-size: .88rem; }
  .listing-grid .card-standard .card-body  { padding: 10px 12px; }
}

/* ── Mobile footer ── */
@media (max-width: 700px) {
  .sf { margin-top: 28px; }

  /* Brand band: stack, center */
  .sf-brand-band  { padding: 28px 0; }
  .sf-brand-inner { flex-direction: column; align-items: center; text-align: center; gap: 18px; }
  .sf-name        { font-size: 1.15rem; }
  .sf-tagline     { font-size: .8rem; max-width: 240px; margin: 0 auto; }
  .sf-social      { justify-content: center; gap: 9px; }
  .sf-ico         { width: 40px; height: 40px; font-size: .9rem; }

  /* Links band: single column, accordion-like with dividers */
  .sf-links-band  { padding: 4px 0; }
  .sf-links-inner { grid-template-columns: 1fr; gap: 0; }

  .sf-nav-block, .sf-support-block {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
  }
  .sf-nav-block h6, .sf-support-block h6 {
    margin-bottom: 12px;
    padding-bottom: 0;
    border-bottom: none;
    font-size: .7rem;
  }

  /* Category links: wrap horizontally on mobile */
  .sf-nav-block:first-child .sf-nav-items {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 0;
  }
  .sf-nav-block:first-child .sf-nav-items a {
    padding: 4px 10px 4px 0;
    border-left: 1px solid var(--border);
    padding-left: 10px;
    font-size: .8rem;
    gap: 5px;
  }
  .sf-nav-block:first-child .sf-nav-items a:last-child { border-left: none; }

  /* Quick links: wrap horizontally too */
  .sf-nav-block:nth-child(2) .sf-nav-items {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 0;
  }
  .sf-nav-block:nth-child(2) .sf-nav-items a {
    padding: 4px 10px 4px 0;
    border-left: 1px solid var(--border);
    padding-left: 10px;
    font-size: .8rem;
  }
  .sf-nav-block:nth-child(2) .sf-nav-items a:last-child { border-left: none; }

  /* Support buttons: full width */
  .sf-support-btn { width: 100%; justify-content: center; padding: 12px; margin-bottom: 8px; }
  .sf-support-block p { font-size: .76rem; margin-bottom: 12px; }

  /* Bottom bar: centered */
  .sf-bottom      { padding: 12px 0; }
  .sf-bottom-inner { flex-direction: column; align-items: center; gap: 4px; }
  .sf-bottom-inner span, .sf-bottom-inner a { font-size: .74rem; }
}

/* ── Mobile hero section improvements ── */
@media (max-width: 600px) {
  .hero-section { padding: 16px 0; }
  .hero-grid    { gap: 10px; }
  .hero-side    { gap: 10px; }
  .card-body-overlay { padding: 16px 14px 14px; }
  .card-body-overlay .card-title { font-size: 1rem; }
  .card-body-overlay .card-title.large { font-size: 1.15rem; }
  .card-body-overlay .card-excerpt { display: none; }
  .card-body-overlay .card-meta { font-size: .72rem; gap: 8px; }
}

/* ── Search page mobile ── */
@media (max-width: 600px) {
  .search-hero { padding: 24px 0; }
  .search-hero h1 { font-size: 1.3rem; }
  .search-form input { font-size: .9rem; padding: 12px 16px; }
  .search-form button { padding: 0 16px; font-size: .85rem; }
}


/* ══════════════════════════════════════════════════════════════
   PAGE TRANSITION OVERLAY
   ══════════════════════════════════════════════════════════════ */
#pageOverlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--bg);
  pointer-events: none;
  animation: overlayReveal .42s ease forwards .02s;
}
@keyframes overlayReveal {
  0%   { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}
body.page-leaving #pageOverlay {
  animation: overlayHide .22s ease forwards;
  pointer-events: all;
  opacity: 0;
  visibility: visible;
}
@keyframes overlayHide {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}


/* ══════════════════════════════════════════════════════════════
   SKELETON SHIMMER — card thumbnails
   ══════════════════════════════════════════════════════════════ */
/* ── Card image fade-in on load ──
   Images with data-src are invisible until the lazy loader removes the attribute.
   CSS attr selector updates instantly when JS does img.removeAttribute('data-src'),
   so no extra JS or class toggling is needed — the transition fires automatically. */
.card-thumb img[data-src],
.sidebar-post-thumb img[data-src] {
  opacity: 0;
}
.card-thumb img,
.sidebar-post-thumb img {
  transition: opacity .4s ease;
}


/* ══════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION
   ══════════════════════════════════════════════════════════════ */
.bottom-nav { display: none; }

@media (max-width: 600px) {

  /* Space for the bottom bar */
  .page-content { padding-bottom: 72px; }
  footer.sf     { padding-bottom: 72px; }
  #backToTop    { bottom: 82px !important; }

  /* ── The bar itself ── */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 990;
    background: rgba(5,6,10,.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,.07);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(0);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
  }
  body.light .bottom-nav {
    background: rgba(245,242,236,.97);
    border-top-color: rgba(0,0,0,.08);
  }
  .bottom-nav.nav-hidden { transform: translateY(100%); }

  /* ── Each item ── */
  .bn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 9px 2px 7px;
    color: var(--muted);
    text-decoration: none;
    font-size: .6rem;
    font-weight: 600;
    font-family: var(--font);
    gap: 4px;
    position: relative;
    transition: color .18s;
    -webkit-tap-highlight-color: transparent;
  }
  .bn-item i { font-size: 1.1rem; transition: transform .2s; }

  /* ── Active state ── */
  .bn-item.active {
    color: var(--accent);
  }
  .bn-item.active i { transform: translateY(-2px); }
  .bn-item.active::before {
    content: '';
    position: absolute;
    top: 0; left: 22%; right: 22%;
    height: 2px;
    background: var(--accent);
    border-radius: 0 0 4px 4px;
  }

  /* ── Press ripple ── */
  .bn-item:active { transform: scale(.88); transition: transform .1s; }

  /* ── Mobile: hide full footer, show compact ── */
  footer.sf .sf-links-band { display: none; }
  footer.sf .sf-brand-band { padding: 20px 0; }

  /* ── More button reset ── */
  button.bn-item { background: none; border: none; cursor: pointer; font-family: var(--font); }
}


/* ══════════════════════════════════════════════════════════════
   MOBILE BOTTOM SHEET
   ══════════════════════════════════════════════════════════════ */
.mobile-sheet { display: none; }

@media (max-width: 600px) {
  .mobile-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 997;
    visibility: hidden;
    pointer-events: none;
  }
  .mobile-sheet.open { visibility: visible; pointer-events: auto; }

  .ms-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.62);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    opacity: 0; transition: opacity .3s;
  }
  .mobile-sheet.open .ms-overlay { opacity: 1; }

  .ms-panel {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-radius: 24px 24px 0 0;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.32,.72,0,1);
    overflow: hidden;
  }
  .mobile-sheet.open .ms-panel { transform: translateY(0); }

  .ms-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 14px auto 10px; }

  .ms-section { padding: 10px 20px 14px; }
  .ms-label { font-size: .67rem; font-weight: 700; color: var(--subtle); text-transform: uppercase; letter-spacing: .1em; margin: 0 0 12px; }
  .ms-divider { height: 1px; background: var(--border); margin: 0 20px; }

  /* Theme row */
  .ms-theme-row { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 4px 0 8px; }
  .ms-mode-opt { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; color: var(--muted); min-width: 48px; transition: color .22s; }
  .ms-mode-opt i { font-size: 1.25rem; transition: transform .22s; }
  .ms-mode-opt.active { color: var(--accent); }
  .ms-mode-opt.active i { transform: scale(1.18); }

  /* Toggle pill */
  .ms-toggle-btn { background: none; border: none; cursor: pointer; padding: 4px; }
  .ms-track { width: 58px; height: 30px; background: rgba(255,255,255,.08); border: 2px solid var(--border); border-radius: 15px; position: relative; transition: background .3s, border-color .3s; }
  body.light .ms-track { background: rgba(200,169,77,.18); border-color: var(--accent); }
  .ms-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .3s cubic-bezier(.4,0,.2,1), background .3s; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
  body.light .ms-knob { transform: translateX(28px); background: var(--accent); }

  /* Nav links */
  .ms-nav { display: flex; flex-direction: column; gap: 2px; }
  .ms-link { display: flex; align-items: center; gap: 14px; padding: 13px 12px; border-radius: 12px; text-decoration: none; color: var(--text); font-size: .95rem; font-weight: 600; font-family: var(--font); transition: background .15s; -webkit-tap-highlight-color: transparent; }
  .ms-link:active { background: var(--soft); }
  .ms-link-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--soft); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 1rem; flex-shrink: 0; }
  .ms-chevron { margin-right: auto; color: var(--subtle) !important; font-size: .8rem !important; }

  /* Close */
  .ms-close { width: 100%; padding: 14px; background: var(--soft); border: 1px solid var(--border); border-radius: 14px; color: var(--text); font-family: var(--font); font-size: .95rem; font-weight: 700; cursor: pointer; transition: background .15s; }
  .ms-close:active { background: var(--border); }
}
