:root {
  --rm-ink: #102a43;
  --rm-blue: #1f5f8b;
  --rm-gold: #c8912b;
  --rm-paper: #fbfaf7;
  --rm-soft: #eef5f8;
  --rm-text: #243b53;
  --rm-muted: #627d98;
  --rm-border: #d9e2ec;
  --rm-green: #2d6a4f;
}

/* Reading pages use a light, high-contrast palette independently of the
   site's dark dashboard theme. Long-form text must remain comfortable. */
body.rm-page {
  --bg: #f8f6f1;
  --bg2: #ffffff;
  --bg3: #eaf1f4;
  --border: #d6e0e5;
  --gold: #8b6518;
  --gold-dark: #6f4f0d;
  --text: #183247;
  --text-muted: #566d7a;
  --shadow: 0 4px 18px rgba(24,50,71,.1);
  background: #f8f6f1;
  color: #183247;
}
body.rm-page .navbar {
  background: rgba(255,255,255,.98);
  border-bottom-color: #d6e0e5;
  box-shadow: 0 2px 12px rgba(24,50,71,.06);
}
body.rm-page .logo-ar { color: #76530f; }
body.rm-page .nav-links a { color: #4c6370; }
body.rm-page .nav-links a:hover,
body.rm-page .nav-links a.active { background: #eaf1f4; color: #173b56; }
body.rm-page .btn-nav { background: #946a17 !important; color: #fff !important; }
body.rm-page .btn-nav:hover { background: #76530f !important; }
body.rm-page .footer { background: #f0ede6; border-top-color: #d6e0e5; color: #566d7a; }

.rm-hero {
  color: #173b56;
  background:
    radial-gradient(circle at 20% 20%, rgba(200,145,43,.14), transparent 38%),
    linear-gradient(135deg, #f7fbfd 0%, #dcebf3 100%);
  border-bottom: 1px solid #cbdde7;
  padding: 76px 24px 68px;
  text-align: center;
}
.rm-hero-inner { max-width: 900px; margin: 0 auto; }
.rm-kicker {
  color: #805a0d;
  font-family: 'Cairo', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  margin-bottom: 16px;
  text-transform: uppercase;
}
.rm-hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.25; margin: 0 0 18px; }
.rm-hero p { color: #425f70; font-size: 1.18rem; line-height: 1.9; margin: 0 auto; max-width: 760px; }
.rm-status {
  background: rgba(255,255,255,.78);
  border: 1px solid #bfd3df;
  border-radius: 999px;
  color: #31566d;
  display: inline-block;
  font-family: 'Cairo', sans-serif;
  font-size: 12px;
  margin-bottom: 22px;
  padding: 7px 15px;
}

.rm-wrap { max-width: 850px; margin: 0 auto; padding: 58px 24px 90px; }
.rm-lead { color: var(--rm-ink); font-size: 1.32rem; line-height: 2; margin-bottom: 42px; }
.rm-section { margin: 0 0 48px; }
.rm-section h2 { color: var(--rm-ink); font-size: 1.85rem; line-height: 1.4; margin: 0 0 20px; }
.rm-section h3 { color: var(--rm-blue); font-size: 1.3rem; line-height: 1.5; margin: 28px 0 12px; }
.rm-section p, .rm-section li { color: var(--rm-text); font-size: 1.08rem; line-height: 2; }
.rm-section p { margin: 0 0 18px; }
.rm-section ul, .rm-section ol { margin: 12px 0 22px; padding-inline-start: 26px; }
.rm-section li { margin-bottom: 8px; }

.rm-question {
  background: var(--rm-soft);
  border-inline-start: 5px solid var(--rm-gold);
  border-radius: 10px;
  color: var(--rm-ink);
  font-size: 1.42rem;
  line-height: 1.8;
  margin: 32px 0;
  padding: 26px 30px;
}
.rm-note {
  background: #fff8e8;
  border: 1px solid #eed69b;
  border-radius: 10px;
  color: #614a16;
  margin: 24px 0;
  padding: 18px 22px;
}
.rm-note p { color: inherit; font-size: 1rem; margin: 0; }

.rm-axis-grid, .rm-three-grid, .rm-metric-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 24px 0;
}
.rm-three-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rm-metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rm-card {
  background: #fff;
  border: 1px solid var(--rm-border);
  border-radius: 12px;
  padding: 22px;
}
.rm-card .rm-icon { display: block; font-size: 1.7rem; margin-bottom: 10px; }
.rm-card h3 { color: var(--rm-ink); font-size: 1.12rem; margin: 0 0 8px; }
.rm-card p { color: var(--rm-muted); font-size: .98rem; line-height: 1.75; margin: 0; }

.rm-equation {
  background: #e9f2f6;
  border: 1px solid #c3d9e4;
  border-radius: 14px;
  color: #173b56;
  direction: ltr;
  font-family: 'Cairo', sans-serif;
  margin: 28px 0;
  padding: 30px 20px;
  text-align: center;
}
.rm-equation strong { color: #76530f; display: block; font-size: clamp(1.7rem, 5vw, 2.6rem); margin-bottom: 8px; }
.rm-equation span { color: #425f70; direction: rtl; display: block; font-size: .95rem; }
[lang="en"] .rm-equation span { direction: ltr; }

.rm-definition {
  background: var(--rm-paper);
  border: 1px solid var(--rm-border);
  border-radius: 12px;
  margin: 24px 0;
  padding: 26px;
}
.rm-definition strong { color: var(--rm-blue); }
.rm-definition p:last-child { margin-bottom: 0; }

.rm-table-wrap { overflow-x: auto; margin: 24px 0; }
.rm-table { border-collapse: collapse; min-width: 680px; width: 100%; }
.rm-table th, .rm-table td { border: 1px solid var(--rm-border); padding: 13px 15px; text-align: start; vertical-align: top; }
.rm-table th { background: #dcebf3; color: #173b56; font-family: 'Cairo', sans-serif; font-size: .9rem; }
.rm-table td { background: #fff; color: var(--rm-text); line-height: 1.65; }

.rm-references { border-top: 1px solid var(--rm-border); margin-top: 56px; padding-top: 32px; }
.rm-references li { font-size: .93rem; line-height: 1.7; margin-bottom: 10px; overflow-wrap: anywhere; }
.rm-references a { color: var(--rm-blue); }
.rm-author-note { color: var(--rm-muted); font-size: .94rem; line-height: 1.8; }
.rm-cta {
  align-items: center;
  background: linear-gradient(135deg, #eaf3f7, #d8e9f1);
  border: 1px solid #bdd4df;
  border-radius: 14px;
  color: #173b56;
  display: flex;
  gap: 22px;
  justify-content: space-between;
  margin-top: 44px;
  padding: 28px;
}
.rm-cta p { color: #31566d; margin: 0; }
.rm-btn {
  background: #8b6518;
  border-radius: 8px;
  color: #fff;
  flex-shrink: 0;
  font-family: 'Cairo', sans-serif;
  font-size: .9rem;
  font-weight: 700;
  padding: 12px 18px;
  text-decoration: none;
}
.rm-byline { color: var(--rm-muted); font-family: 'Cairo', sans-serif; font-size: .9rem; margin-top: 16px; }

@media (max-width: 760px) {
  .rm-hero { padding: 58px 20px 52px; }
  .rm-wrap { padding: 42px 18px 70px; }
  .rm-axis-grid, .rm-three-grid, .rm-metric-grid { grid-template-columns: 1fr; }
  .rm-cta { align-items: stretch; flex-direction: column; }
  .rm-btn { text-align: center; }
}
