/* =========================================================================
   حساباتى — نظام تصميم مشترك
   فكرة التصميم: دفتر حسابات هادئ وموثوق، الأرقام هي البطلة.
   ========================================================================= */


:root {
  --paper: #F3F5F9;
  --surface: #FFFFFF;
  --surface-soft: #E9EEF5;
  --ink: #0B1B2E;
  --ink-soft: #4A5B70;
  --ink-faint: #6F7E91;
  --line: rgba(11, 27, 46, 0.10);
  --line-strong: rgba(11, 27, 46, 0.22);

  --brand: #0A2C52;
  --brand-deep: #061B35;
  --brand-bright: #0B62B8;
  --brand-wash: #E6EEF8;

  --gold: #A9761F;
  --gold-bright: #E0B15A;
  --gold-wash: #FAF1DD;

  --gain: #14803F;
  --gain-wash: #E5F4EB;
  --cost: #B3402C;
  --cost-wash: #FBE9E5;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(11, 27, 46, 0.06);
  --shadow-md: 0 10px 30px rgba(11, 27, 46, 0.10);
  --shadow-lg: 0 24px 60px rgba(6, 27, 53, 0.22);

  --font-display: 'Cairo', 'IBM Plex Sans Arabic', sans-serif;
  --font-body: 'IBM Plex Sans Arabic', 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', 'IBM Plex Sans Arabic', monospace;

  --container: 1200px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

@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;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  direction: rtl;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.5em;
  letter-spacing: 0.2px;
}
h1 { font-size: clamp(1.8rem, 1.4rem + 1.8vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.8rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; color: var(--ink); }
a { color: var(--brand-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

.num, .mono, input[type="number"], input[type="range"] + .value-badge {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}

:focus-visible {
  outline: 2.5px solid var(--brand-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

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

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

/* ---------------------------------------------------------------------
   الرأس والتنقل (نمط مواقع البنوك: شريط علوي + رأس أبيض + قائمة كبيرة)
   --------------------------------------------------------------------- */
.utility-bar { background: var(--brand-deep); color: rgba(255,255,255,0.78); font-size: 0.78rem; }
.utility-bar .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 7px; padding-bottom: 7px; }
.utility-bar a { color: rgba(255,255,255,0.78); }
.utility-bar a:hover { color: #fff; text-decoration: none; }
.utility-bar .links { display: flex; gap: 18px; }
.utility-bar .secure { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 640px) { .utility-bar .links { display: none; } }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(11,27,46,0.03);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding-top: 12px; padding-bottom: 12px;
}
.brand-mark {
  display: flex; align-items: center; gap: 9px;
  color: var(--brand); flex-shrink: 0;
}
.brand-mark:hover { text-decoration: none; }
.brand-logo { flex-shrink: 0; display: block; border-radius: 10px; transition: transform .2s ease; }
.brand-mark:hover .brand-logo { transform: translateY(-1px); }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.55rem; line-height: 1; color: var(--brand); }
nav.main-nav { display: flex; gap: 2px; align-items: center; margin-inline-end: auto; }
nav.main-nav a {
  color: var(--ink);
  font-weight: 600; font-size: 0.94rem;
  padding: 10px 14px;
  border-bottom: 3px solid transparent;
  border-radius: 0;
}
nav.main-nav a:hover, nav.main-nav a.active {
  color: var(--brand-bright);
  border-bottom-color: var(--brand-bright);
  text-decoration: none;
}
.header-cta { white-space: nowrap; }
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  width: 42px; height: 38px; cursor: pointer; color: var(--ink);
}

.nav-dropdown-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; border-bottom: 3px solid transparent; font: inherit; font-weight: 600; font-size: 0.94rem; color: var(--ink);
  padding: 10px 14px; cursor: pointer;
}
.nav-dropdown-toggle:hover, .nav-dropdown-toggle[aria-expanded="true"] { color: var(--brand-bright); border-bottom-color: var(--brand-bright); }
.nav-dropdown-toggle svg { transition: transform .15s ease; }
.nav-dropdown-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* القائمة الكبيرة (Mega menu) */
.calc-strip {
  display: none;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 30px 40px -20px rgba(6, 27, 53, 0.28);
  position: absolute; inset-inline: 0; top: 100%;
}
.calc-strip.open { display: block; }
.calc-strip .container {
  display: flex; flex-direction: column; gap: 16px;
  padding: 24px 20px 28px;
  max-height: 70vh;
  overflow-y: auto;
}
.calc-strip .calc-group-title {
  display: block;
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 0.95rem; font-weight: 800;
  padding-bottom: 10px; margin-bottom: 8px;
  border-bottom: 2px solid var(--gold-bright);
}
.calc-strip .calc-group-links { display: flex; flex-direction: column; gap: 0; }
.calc-strip a {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--ink);
  font-size: 0.92rem; font-weight: 500;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
  transition: color .15s ease, padding .15s ease;
}
.calc-strip a::after { content: "←"; opacity: 0; color: var(--brand-bright); transition: opacity .15s ease; }
.calc-strip a:hover::after { opacity: 1; }
.calc-strip a:hover { color: var(--brand-bright); padding-inline-start: 8px; text-decoration: none; }
.calc-strip a.active { color: var(--brand-bright); font-weight: 700; }

@media (min-width: 900px) {
  .calc-strip .container {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
    align-items: start;
    max-height: none; overflow-y: visible;
  }
  .calc-strip .calc-group { min-width: 0; }
}

@media (max-width: 900px) {
  .header-cta { display: none; }
}
@media (max-width: 1024px) {
  nav.main-nav {
    display: none;
    position: absolute; inset-inline: 0; top: 100%;
    background: var(--surface);
    flex-direction: column; align-items: stretch; gap: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px;
    max-height: 80vh; overflow-y: auto;
    z-index: 45;
    box-shadow: var(--shadow-md);
  }
  nav.main-nav.open { display: flex; }
  nav.main-nav a { padding: 13px 4px; border-bottom: 1px solid var(--line); }
  nav.main-nav .nav-dropdown-toggle { justify-content: space-between; padding: 13px 4px; width: 100%; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: block; }
  .calc-strip .container { padding: 14px 20px 16px; }
}

/* ---------------------------------------------------------------------
   الشريط الحي للأسعار
   --------------------------------------------------------------------- */
.live-strip {
  background: var(--brand-wash);
  border-bottom: 1px solid rgba(11, 98, 184, 0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
  color: var(--ink);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(to left, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.live-strip::-webkit-scrollbar { display: none; }
.live-strip .container {
  display: flex; gap: 26px; padding: 9px 20px; align-items: center;
}
.live-strip .item { display: flex; gap: 6px; align-items: baseline; font-size: 0.84rem; flex-shrink: 0; }
.live-strip a.item { color: inherit; border-radius: var(--radius-sm); padding: 3px 6px; margin: -3px -6px; transition: background .15s ease; }
.live-strip a.item:hover { background: rgba(255,255,255,0.7); text-decoration: none; }
.live-strip .item .label { color: var(--ink-soft); font-weight: 400; }
.live-strip .item .value { font-family: var(--font-mono); font-weight: 500; color: var(--brand); }
.live-strip .item .chg { font-size: 0.78rem; font-family: var(--font-mono); }
.live-strip .item .chg.up { color: var(--gain); }
.live-strip .item .chg.down { color: var(--cost); }
.live-strip .updated { margin-inline-start: auto; color: var(--brand-bright); font-weight: 500; font-size: 0.78rem; flex-shrink: 0; }
.live-strip .updated:hover { color: var(--brand); text-decoration: none; }

/* ---------------------------------------------------------------------
   نمط بصري خفيف مستوحى من الأشكال الهندسية الإسلامية (مشربية)
   --------------------------------------------------------------------- */
.lattice-bg {
  background-color: var(--brand-deep);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.08' stroke-width='1'%3E%3Cpath d='M28 0 L56 28 L28 56 L0 28 Z'/%3E%3Ccircle cx='28' cy='28' r='13'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------------
   عناصر عامة: أزرار، بطاقات، شارات
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  cursor: pointer; transition: transform 0.12s ease, background 0.15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 3px solid rgba(11, 98, 184, 0.35); outline-offset: 2px; }
.btn-primary:hover, .btn-gold:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(6, 27, 53, 0.22); }
.btn-outline-light:hover { transform: translateY(-2px); border-color: #fff; }
.btn .arrow { display: inline-block; transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(-4px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-bright); text-decoration: none; }
.btn-gold { background: var(--gold-bright); color: var(--brand-deep); }
.btn-gold:hover { background: #ECC272; text-decoration: none; }
.btn-light { background: #fff; color: var(--brand); }
.btn-light:hover { background: var(--brand-wash); text-decoration: none; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.55); }
.btn-outline-light:hover { background: rgba(255,255,255,0.12); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--brand-wash); text-decoration: none; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.74rem; font-weight: 600;
  padding: 3px 10px; border-radius: 4px;
}
.badge-gold { background: var(--gold-wash); color: #7A5310; }
.badge-gain { background: var(--gain-wash); color: var(--gain); }
.badge-cost { background: var(--cost-wash); color: var(--cost); }
.badge-neutral { background: var(--surface-soft); color: var(--ink-soft); }

.value-gain { color: var(--gain); }
.value-cost { color: var(--cost); }

/* ---------------------------------------------------------------------
   شبكة أدوات الصفحة الرئيسية
   --------------------------------------------------------------------- */
.tool-category { margin: 34px 0 10px; }
.tool-category h2 { color: var(--brand); position: relative; padding-inline-start: 14px; }
.tool-category h2::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.2em; bottom: 0.2em; width: 4px; border-radius: 2px; background: var(--gold-bright); }
.tool-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.tool-grid.grid-2x2 { grid-template-columns: 1fr; grid-auto-rows: 1fr; align-items: stretch; }
@media (min-width: 640px) { .tool-grid.grid-2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  border-top: 3px solid var(--brand);
  padding: 22px 20px 20px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
  min-height: 240px; height: 100%; box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .2s ease, transform .15s ease;
}
.tool-card:hover { border-top-color: var(--gold-bright); box-shadow: var(--shadow-md); transform: translateY(-3px); text-decoration: none; }
.tool-card .icon { width: 46px; height: 46px; padding: 10px; border-radius: 10px; background: var(--brand-wash); color: var(--brand); box-sizing: border-box; }
.tool-card h3 { margin: 0; color: var(--ink); font-family: var(--font-body); font-size: 1.02rem; font-weight: 700; }
.tool-card p {
  margin: 0; color: var(--ink-soft); font-size: 0.88rem; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tool-card .tool-cta {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: auto; padding-top: 6px; align-self: flex-start;
  background: transparent; color: var(--brand-bright);
  font-size: 0.86rem; font-weight: 700;
  border-radius: 0;
  transition: gap .15s ease;
}
.tool-card:hover .tool-cta { gap: 10px; }
.tool-card p { flex: 1; }

/* ---------------------------------------------------------------------
   تخطيط صفحة الحاسبة: نموذج + نتيجة لاصقة
   --------------------------------------------------------------------- */
.calc-layout {
  display: grid; gap: 22px;
  grid-template-columns: 1fr;
  align-items: start;
  margin: 22px 0 40px;
}
@media (min-width: 900px) {
  .calc-layout { grid-template-columns: 1.05fr 0.95fr; }
  .calc-layout .result-panel { position: sticky; top: 84px; }
}

.field { margin-bottom: 18px; }
.field label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; color: var(--ink);
}
.field .hint { font-weight: 400; color: var(--ink-faint); font-size: 0.78rem; }

.field-value {
  font-family: var(--font-mono); font-weight: 600; color: var(--brand);
}

input[type="text"], input[type="number"], select, textarea {
  width: 100%; padding: 11px 13px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-size: 1rem;
  font-family: var(--font-body);
}
input[type="number"] { font-family: var(--font-mono); }
input:focus, select:focus, textarea:focus { border-color: var(--brand-bright); }

input[type="range"] {
  width: 100%; height: 6px; border-radius: 999px;
  background: var(--surface-soft); appearance: none; margin-top: 10px;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-strong);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-strong);
  cursor: pointer;
}

.slider-row { display: flex; gap: 10px; align-items: center; }
.slider-row input[type="number"] { max-width: 130px; flex-shrink: 0; }

.segmented {
  display: inline-flex; background: var(--surface-soft); border-radius: var(--radius-sm); padding: 3px; gap: 2px;
}
.segmented button {
  border: none; background: transparent; padding: 8px 14px; border-radius: 4px;
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); cursor: pointer;
}
.segmented button.active { background: var(--brand); color: #fff; }

.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.preset-chip {
  border: 1.5px solid var(--line-strong); background: var(--surface);
  border-radius: var(--radius-sm); padding: 8px 16px; font-size: 0.86rem; font-weight: 600;
  cursor: pointer; color: var(--ink-soft);
}
.preset-chip.active { border-color: var(--brand); background: var(--brand-wash); color: var(--brand); }

/* ---------------------------------------------------------------------
   لوحة النتيجة
   --------------------------------------------------------------------- */
.result-panel { background: linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 100%); color: #fff; border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-md); border-top: 4px solid var(--gold-bright); }
.result-hero { text-align: center; padding: 6px 0 20px; border-bottom: 1px solid rgba(255,255,255,0.18); margin-bottom: 18px; }
.result-hero .figure {
  font-family: var(--font-mono); font-size: clamp(2rem, 1.6rem + 1.6vw, 2.7rem); font-weight: 600;
  direction: ltr; display: inline-block;
}
.result-hero .unit { font-size: 1rem; margin-inline-start: 6px; opacity: 0.85; }
.result-hero .caption { color: rgba(255,255,255,0.75); font-size: 0.88rem; margin-top: 6px; }

.result-rows { display: flex; flex-direction: column; gap: 12px; }
.result-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.92rem; }
.result-row .k { color: rgba(255,255,255,0.75); }
.result-row .v { font-family: var(--font-mono); font-weight: 600; }

.result-panel .note {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.18);
  font-size: 0.8rem; color: rgba(255,255,255,0.72); line-height: 1.6;
}

/* ---------------------------------------------------------------------
   الجداول (جدول السداد، المقارنات)
   --------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead th {
  background: var(--surface-soft); text-align: start; padding: 10px 12px;
  font-weight: 600; color: var(--ink-soft); position: sticky; top: 0;
}
tbody td { padding: 9px 12px; border-top: 1px solid var(--line); font-family: var(--font-mono); }
tbody td:first-child { font-family: var(--font-body); }
tbody tr:nth-child(even) { background: rgba(30,39,35,0.02); }

/* ---------------------------------------------------------------------
   بطاقات المقارنة
   --------------------------------------------------------------------- */
.compare-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 16px; }
.compare-card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-md); padding: 18px; position: relative; }
.compare-card.best { border-color: var(--gold-bright); box-shadow: var(--shadow-md); }
.compare-card .bank { color: var(--ink-soft); font-size: 0.82rem; }

/* شعارات البنوك: لوحة بيضا بإطار خفيف وزوايا ناعمة (بتبان كويس على أي خلفية) */
.bank-with-logo { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.bank-with-logo .bank-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink-soft); }
.bank-logo {
  --size: 32px;
  position: relative; flex-shrink: 0; width: var(--size); height: var(--size);
  display: grid; place-items: center; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  box-shadow: 0 1px 2px rgba(11, 27, 46, 0.06);
}
.bank-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; box-sizing: border-box; }
/* الشعارات الرسمية عريضة (نص + رمز): اللوحة بتاخد عرض الشعار بنفس الارتفاع بدل ما يتحشر في مربع */
.bank-logo:not(.no-img) { width: auto; min-width: var(--size); max-width: calc(var(--size) * 3.4); padding: 4px 7px; box-sizing: border-box; }
.bank-logo:not(.no-img) img { width: auto; max-width: 100%; height: 100%; padding: 0; }
.bank-logo .bank-mono {
  display: none; width: 100%; height: 100%; place-items: center; color: #fff;
  font: 700 calc(var(--size) * 0.3) / 1 var(--font-mono); letter-spacing: -0.02em; direction: ltr;
}
.bank-logo.no-img { border-color: transparent; }
.bank-logo.no-img .bank-mono { display: grid; }
.compare-card .bank { margin-bottom: 4px; }
.redeem-bank { display: flex; align-items: center; gap: 8px; }
.compare-card .name { font-weight: 700; margin: 2px 0 10px; }
.compare-card .rate { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 600; color: var(--brand); }
.compare-card { display: flex; flex-direction: column; }
.compare-card .stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 0.85rem; margin-top: 6px; color: var(--ink-soft); }
.compare-card .stat > span { flex-shrink: 0; }
.compare-card .stat b { font-family: var(--font-mono); color: var(--ink); text-align: end; min-width: 0; }
.compare-card .stat.redeem { align-items: flex-start; }
.compare-card .stat.redeem .redeem-val { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0; }
.compare-card .stat.redeem b {
  font-family: var(--font-body); font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  max-height: 2.9em; line-height: 1.45;
}
.redeem-more { background: none; border: 0; padding: 0; color: var(--brand-bright); font: 600 0.76rem var(--font-body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.redeem-more:hover { color: var(--brand); }
.compare-card .notes { font-size: 0.78rem; margin: 8px 0 0; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.compare-card .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.compare-card .src { display: block; margin-top: auto; padding-top: 12px; font-size: 0.72rem; color: var(--ink-faint); }

/* ---------------------------------------------------------------------
   شريط تقدم النصاب (زكاة)
   --------------------------------------------------------------------- */
.progress-track { background: var(--surface-soft); border-radius: 999px; height: 14px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--brand)); transition: width .4s ease; border-radius: 999px; }
.progress-labels { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--ink-soft); margin-top: 6px; }

/* ---------------------------------------------------------------------
   تبويبات
   --------------------------------------------------------------------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs button {
  border: none; background: none; padding: 10px 6px; font-family: var(--font-body);
  font-weight: 600; color: var(--ink-faint); cursor: pointer; border-bottom: 2.5px solid transparent; margin-inline-end: 14px;
}
.tabs button.active { color: var(--brand); border-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------------------------------------------------------------------
   أكورديون الأسئلة الشائعة
   --------------------------------------------------------------------- */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  cursor: pointer; padding: 18px 4px; font-weight: 700; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .chev { transition: transform .2s ease; color: var(--brand); flex-shrink: 0; }
.faq-item[open] summary .chev { transform: rotate(45deg); }
.faq-item .a { padding: 0 4px 18px; color: var(--ink-soft); }

/* ---------------------------------------------------------------------
   شبكات عامة / مساعدات
   --------------------------------------------------------------------- */
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); }

/* ---------------------------------------------------------------------
   محوّل العملات في صفحة الأسعار
   --------------------------------------------------------------------- */
.conv-fields {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.conv-result {
  margin: 14px 0 0; padding: 16px 18px;
  background: var(--brand-wash); border-radius: var(--radius-md);
  font-size: 1.2rem; font-weight: 700; color: var(--brand);
  text-align: center;
}
.stack { display: flex; flex-direction: column; gap: 10px; }
.section { padding-top: 44px; padding-bottom: 44px; }
.section-narrow { max-width: 760px; margin: 0 auto; }
.text-soft { color: var(--ink-soft); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }

/* رأس الصفحات الداخلية القديم (للصفحات التي ما زالت تستخدم .hero) */
.hero { padding-top: 40px; padding-bottom: 12px; }
.hero h1 { color: var(--brand); }
.hero .lede { font-size: 1.08rem; color: var(--ink-soft); max-width: 620px; }

/* ---------------------------------------------------------------------
   الواجهة الرئيسية بنمط البنوك: بطل + محاكي + شريط أرقام + خطوات + دعوة
   --------------------------------------------------------------------- */
.bank-hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(224,177,90,0.20), transparent 60%),
    linear-gradient(135deg, var(--brand-deep) 0%, var(--brand) 60%, #0F3F73 100%);
}
.bank-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.05' stroke-width='1'%3E%3Cpath d='M36 0 L72 36 L36 72 L0 36 Z'/%3E%3Ccircle cx='36' cy='36' r='17'/%3E%3C/g%3E%3C/svg%3E");
}
.bank-hero .container {
  position: relative; z-index: 1;
  display: grid; gap: 40px; align-items: center;
  grid-template-columns: 1fr;
  padding-top: 56px; padding-bottom: 64px;
}
@media (min-width: 960px) { .bank-hero .container { grid-template-columns: 1.1fr 0.9fr; padding-top: 72px; padding-bottom: 80px; } }
.bank-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.18);
  padding: 6px 14px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; color: var(--gold-bright);
  margin-bottom: 18px;
}
.bank-hero h1 { color: #fff; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.3rem); font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.bank-hero h1 em { font-style: normal; color: var(--gold-bright); }
.bank-hero .lede { color: rgba(255,255,255,0.82); font-size: 1.1rem; max-width: 560px; margin-bottom: 26px; }
.bank-hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.bank-hero .hero-points { list-style: none; padding: 0; margin: 26px 0 0; display: flex; gap: 22px; flex-wrap: wrap; color: rgba(255,255,255,0.8); font-size: 0.86rem; }
.bank-hero .hero-points li { display: inline-flex; align-items: center; gap: 7px; }
.bank-hero .hero-points svg { color: var(--gold-bright); flex-shrink: 0; }

/* محاكي العائد السريع */
.sim-card {
  background: var(--surface); color: var(--ink);
  border-radius: 20px; padding: 28px;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 30px 70px rgba(3, 14, 30, 0.45), 0 0 0 6px rgba(255,255,255,0.08);
  position: relative;
}
.sim-card::before {
  content: ""; position: absolute; inset-inline: 28px; top: 0; height: 4px;
  border-radius: 0 0 4px 4px; background: linear-gradient(90deg, var(--gold-bright), #F3CE84);
}
.sim-card input, .sim-card select { border-radius: 10px; background: var(--paper); }
.sim-card input:focus, .sim-card select:focus { background: var(--surface); box-shadow: 0 0 0 3px rgba(11, 98, 184, 0.15); outline: none; }
.sim-card h2 { font-size: 1.25rem; color: var(--brand); margin-bottom: 4px; }
.sim-card .sub { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 18px; }
.sim-card .field { margin-bottom: 14px; }
.sim-result { background: linear-gradient(160deg, var(--brand-wash), #F4F8FD); border: 1px solid rgba(11, 98, 184, 0.14); border-radius: 14px; padding: 16px 18px; margin-top: 6px; }
.sim-result .big { font-family: var(--font-mono); direction: ltr; unicode-bidi: isolate; display: block; text-align: start; font-size: 1.9rem; font-weight: 600; color: var(--brand); }
.sim-result .lbl { font-size: 0.82rem; color: var(--ink-soft); }
.sim-result .rows { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 0.84rem; color: var(--ink-soft); flex-wrap: wrap; }
.sim-result .rows b { color: var(--ink); font-family: var(--font-mono); }
.sim-card .fine { font-size: 0.74rem; color: var(--ink-faint); margin: 12px 0 0; }
.sim-card .btn { width: 100%; margin-top: 16px; padding: 15px 22px; font-size: 1rem; border-radius: 12px; }

/* شريط الأرقام */
.stats-bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.stats-bar .container { display: grid; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .stats-bar .container { grid-template-columns: repeat(4, 1fr); } }
.stats-bar .stat { padding: 22px 16px; text-align: center; border-inline-start: 1px solid var(--line); }
.stats-bar .stat:first-child { border-inline-start: none; }
@media (max-width: 759px) { .stats-bar .stat:nth-child(3) { border-inline-start: none; } .stats-bar .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }
.stats-bar .stat b { display: block; font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; color: var(--brand); line-height: 1.2; }
.stats-bar .stat span { font-size: 0.84rem; color: var(--ink-soft); }

/* عناوين الأقسام */
.section-head { max-width: 640px; margin-bottom: 26px; }
.section-head .kicker { color: var(--gold); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.04em; }
.section-head h2 { color: var(--brand); margin: 4px 0 8px; }
.section-head p { color: var(--ink-soft); margin: 0; }

/* بطاقات "ابدأ من هنا" الكبيرة */
.feature-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); grid-auto-rows: 1fr; }
.feature-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px 24px; color: var(--ink);
  transition: box-shadow .2s ease, transform .15s ease, border-color .15s ease;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--brand-bright); text-decoration: none; }
.feature-card .ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--brand); color: var(--gold-bright); }
.feature-card h3 { margin: 6px 0 0; color: var(--brand); font-size: 1.2rem; }
.feature-card p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; flex: 1; }
.feature-card .more { color: var(--brand-bright); font-weight: 700; font-size: 0.9rem; margin-top: auto; }
.feature-card .tag { position: absolute; top: 18px; inset-inline-end: 18px; }

/* خطوات */
.steps { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 24px 22px; position: relative; }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--brand); color: var(--gold-bright); font-family: var(--font-mono); font-weight: 600; margin-bottom: 12px;
}
.step h3 { font-size: 1.05rem; margin-bottom: 6px; color: var(--brand); }
.step p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }

/* شريط دعوة للإجراء */
.cta-band { background: linear-gradient(120deg, var(--brand) 0%, var(--brand-deep) 100%); color: #fff; border-radius: var(--radius-lg); padding: 34px 30px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-inline-start: 6px solid var(--gold-bright); }
.cta-band h2 { color: #fff; margin: 0 0 4px; font-size: 1.4rem; }
.cta-band p { margin: 0; color: rgba(255,255,255,0.8); }

.band-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------------------------------------------------------------------
   مسار التنقل (Breadcrumbs) — يظهر أعلى كل حاسبة
   --------------------------------------------------------------------- */
.breadcrumbs {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 12px 20px 0;
  font-size: 0.82rem; color: var(--ink-faint);
}
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs a:hover { color: var(--brand); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }
.breadcrumbs .sep { color: var(--line-strong); }

/* ---------------------------------------------------------------------
   شريط الأمان والخصوصية — يظهر أعلى كل حاسبة قبل إدخال أي رقم
   --------------------------------------------------------------------- */
.trust-badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--gain-wash); color: var(--gain);
  font-size: 0.84rem; font-weight: 600;
  padding: 10px 20px; margin-top: 10px;
}
.trust-badge svg { flex-shrink: 0; }
@media (max-width: 480px) {
  .trust-badge { font-size: 0.78rem; padding: 9px 14px; }
}

/* ---------------------------------------------------------------------
   نصوص إرشادية (Tooltips) — أيقونة "؟" بجانب المصطلحات المبهمة
   --------------------------------------------------------------------- */
.info-tip {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--brand-wash); color: var(--brand);
  font-size: 0.68rem; font-weight: 700; line-height: 1;
  cursor: help; margin-inline-start: 5px; vertical-align: middle;
  outline: none;
}
.info-tip:hover, .info-tip:focus { background: var(--brand); color: #fff; }
.info-tip .info-tip-bubble {
  position: absolute; bottom: calc(100% + 9px); left: 50%;
  transform: translate(-50%, 4px);
  width: max-content; max-width: 240px;
  background: var(--ink); color: #fff;
  font-size: 0.78rem; font-weight: 400; line-height: 1.6;
  padding: 8px 12px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 20; text-align: right;
}
.info-tip .info-tip-bubble::after {
  content: ""; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--ink);
}
.info-tip:hover .info-tip-bubble, .info-tip:focus .info-tip-bubble {
  opacity: 1; visibility: visible; transform: translate(-50%, 0);
}
@media (max-width: 480px) {
  .info-tip .info-tip-bubble { max-width: min(200px, calc(100vw - 48px)); font-size: 0.74rem; }
}

.alert {
  border-radius: var(--radius-md); padding: 14px 16px; font-size: 0.88rem; border: 1px solid;
}
.alert-info { background: var(--brand-wash); border-color: transparent; color: var(--brand); }
.alert-warn { background: var(--gold-wash); border-color: transparent; color: #7A5310; }

.flash-up { animation: flashUp 1.1s ease; }
.flash-down { animation: flashDown 1.1s ease; }
@keyframes flashUp { 0% { background: var(--gain-wash); } 100% { background: transparent; } }
@keyframes flashDown { 0% { background: var(--cost-wash); } 100% { background: transparent; } }

.sparkline { display: block; }

/* ---------------------------------------------------------------------
   تذييل الصفحة
   --------------------------------------------------------------------- */
footer.site-footer {
  margin-top: 60px;
  background: var(--brand-deep); color: rgba(255,255,255,0.75);
  border-top: 4px solid var(--gold-bright);
}
footer.site-footer .container { padding: 44px 20px 26px; }
footer.site-footer .cols { display: grid; column-gap: 24px; row-gap: 30px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (min-width: 700px) { footer.site-footer .cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1080px) { footer.site-footer .cols { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
footer.site-footer .cols > div:first-child {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px;
  padding-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,0.12);
}
footer.site-footer .cols > div:first-child .footer-brand { margin-bottom: 0; }
footer.site-footer .cols > div:first-child .footer-about { flex: 1 1 360px; max-width: 640px; }
footer.site-footer .cols > div:not(:first-child) { display: flex; flex-direction: column; gap: 2px; }
footer.site-footer h4 { font-size: 0.95rem; color: #fff; margin: 0 0 10px; font-family: var(--font-display); }
footer.site-footer a { color: rgba(255,255,255,0.72); display: block; padding: 5px 0; font-size: 0.88rem; line-height: 1.5; }
footer.site-footer a:hover { color: var(--gold-bright); text-decoration: none; }
footer.site-footer .footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; margin-bottom: 8px; }
footer.site-footer .footer-about { font-size: 0.86rem; line-height: 1.8; color: rgba(255,255,255,0.65); margin: 0; }
footer.site-footer .disclaimer { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.14); font-size: 0.78rem; color: rgba(255,255,255,0.55); line-height: 1.8; }

.ad-slot { margin: 28px 0; text-align: center; overflow: hidden; min-height: 90px; }

@media print {
  .utility-bar, .site-header, .live-strip, footer.site-footer, .no-print { display: none !important; }
  body { background: #fff; }
  .result-panel { background: #fff !important; color: #000 !important; border: 1.5px solid #000; }
  .result-row .k, .result-hero .caption { color: #333 !important; }
}

footer.site-footer .footer-brand img { border-radius: 11px; box-shadow: 0 0 0 1px rgba(255,255,255,0.14); }
footer.site-footer .footer-brand span { line-height: 1; }

/* ---------------------------------------------------------------------
   صفحة دليل المبتدئ
   --------------------------------------------------------------------- */
.guide-layout { display: grid; gap: 36px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .guide-layout { grid-template-columns: 240px 1fr; } }
.guide-toc { position: sticky; top: 90px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 18px; display: flex; flex-direction: column; gap: 2px; border-top: 3px solid var(--gold-bright); }
.guide-toc strong { color: var(--brand); font-family: var(--font-display); margin-bottom: 8px; }
.guide-toc a { color: var(--ink-soft); font-size: 0.9rem; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.guide-toc a:last-child { border-bottom: none; }
.guide-toc a:hover { color: var(--brand-bright); text-decoration: none; }
@media (max-width: 959px) { .guide-toc { position: static; } }
.guide-block { margin-bottom: 52px; scroll-margin-top: 90px; }
.guide-table th, .guide-table td { text-align: start; vertical-align: top; font-family: var(--font-body); }
.guide-table tbody td:first-child { white-space: nowrap; }
.cta-row-inline { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.bars { display: flex; flex-direction: column; gap: 14px; margin: 8px 0 14px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; font-size: 0.9rem; }
.bar-track { background: var(--surface-soft); border-radius: 6px; height: 22px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; transition: width .4s ease; }
.bar-fill.simple { background: var(--ink-faint); }
.bar-fill.comp { background: linear-gradient(90deg, var(--brand), var(--brand-bright)); }
@media (max-width: 560px) { .bar-row { grid-template-columns: 1fr; gap: 4px; } }
.compound-note { color: var(--gain); font-weight: 600; margin: 0 0 8px; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.check-list li { background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--cost); border-radius: var(--radius-md); padding: 14px 16px; }
.glossary { display: grid; gap: 0; margin: 0; }
.glossary > div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.glossary dt { font-weight: 700; color: var(--brand); }
.glossary dd { margin: 4px 0 0; color: var(--ink-soft); }

/* ---------------------------------------------------------------------
   شريط موافقة الكوكيز
   --------------------------------------------------------------------- */
.cc-wrap { position: fixed; z-index: 90; inset-inline: 0; bottom: 0; display: flex; justify-content: center; padding: 0 14px 14px; pointer-events: none; transform: translateY(24px); opacity: 0; transition: transform .28s ease, opacity .28s ease; }
.cc-wrap[hidden] { display: none; }
.cc-wrap.cc-in { transform: none; opacity: 1; }
.cc-card { pointer-events: auto; width: 100%; max-width: 760px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--gold-bright); border-radius: var(--radius-lg); box-shadow: 0 -6px 40px rgba(6, 27, 53, 0.22); padding: 18px 20px 16px; max-height: 88vh; overflow-y: auto; }
.cc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cc-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-wash); color: var(--brand); flex-shrink: 0; }
.cc-card h2 { margin: 0; font-size: 1.08rem; color: var(--brand); }
.cc-card p { margin: 0 0 12px; font-size: 0.88rem; line-height: 1.75; color: var(--ink-soft); }
.cc-card p a { color: var(--brand-bright); font-weight: 600; text-decoration: underline; }
.cc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cc-btn { font-family: var(--font-body); font-size: 0.9rem; font-weight: 700; cursor: pointer; border-radius: var(--radius-sm); padding: 11px 20px; border: 1.5px solid transparent; }
.cc-btn[hidden] { display: none; }
.cc-main { background: var(--brand); color: #fff; border-color: var(--brand); }
.cc-main:hover { background: var(--brand-bright); border-color: var(--brand-bright); }
.cc-main.cc-alt { background: var(--surface); color: var(--brand); border-color: var(--brand); }
.cc-main.cc-alt:hover { background: var(--brand-wash); }
.cc-link { background: none; color: var(--brand-bright); text-decoration: underline; padding-inline: 10px; }
.cc-prefs { display: grid; gap: 8px; margin: 0 0 14px; }
.cc-prefs[hidden] { display: none; }
.cc-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); }
.cc-row b { display: block; font-size: 0.92rem; color: var(--ink); }
.cc-row small { display: block; color: var(--ink-faint); font-size: 0.78rem; line-height: 1.55; margin-top: 2px; }
.cc-on { font-size: 0.78rem; font-weight: 700; color: var(--gain); background: var(--gain-wash); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.cc-sw { position: relative; cursor: pointer; }
.cc-sw input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; margin: 0; z-index: 2; }
.cc-track { width: 46px; height: 26px; border-radius: 999px; background: var(--line-strong); position: relative; flex-shrink: 0; transition: background .15s; }
.cc-track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: inset-inline-start .15s; }
.cc-sw input:checked ~ .cc-track { background: var(--brand); }
.cc-sw input:checked ~ .cc-track::after { inset-inline-start: 23px; }
.cc-sw input:focus-visible ~ .cc-track { outline: 2.5px solid var(--brand-bright); outline-offset: 2px; }
body.cc-open { padding-bottom: 150px; }
@media (max-width: 560px) {
  .cc-wrap { padding: 0 8px 8px; }
  .cc-card { padding: 14px 14px 12px; }
  .cc-actions .cc-main { flex: 1 1 100%; }
  .cc-link { flex: 1 1 100%; text-align: center; }
  body.cc-open { padding-bottom: 300px; }
}
@media print { .cc-wrap { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .cc-wrap { transition: none; } }


/* ---------------------------------------------------------------------
   ختم حداثة البيانات + تنبيه تغيير الفائدة
   --------------------------------------------------------------------- */
.hb-badge { background: var(--brand-wash); border: 1px solid var(--line); border-inline-start: 4px solid var(--brand); border-radius: var(--radius-md); padding: 14px 18px; margin: 18px 0 6px; font-size: 0.86rem; }
.hb-slot { min-height: 190px; margin: 18px 0 6px; border-radius: var(--radius-md); background: var(--brand-wash); }
.hb-fold summary { cursor: pointer; color: var(--brand-bright); font-weight: 600; font-size: 0.82rem; }
@media (max-width: 640px) { .hb-slot { min-height: 88px; } }
.hb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.hb-head strong { color: var(--brand); font-size: 0.92rem; }
.hb-chip { font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.hb-chip.fresh { background: var(--gain-wash); color: var(--gain); }
.hb-chip.partial { background: var(--gold-wash); color: #7A5310; }
.hb-chip.stale { background: var(--cost-wash); color: var(--cost); }
.hb-line { margin: 2px 0; color: var(--ink-soft); line-height: 1.7; }
.hb-warn { color: #7A5310; font-weight: 600; }
.hb-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.hb-alert-btn { display: inline-flex; align-items: center; gap: 7px; background: var(--surface); color: var(--brand); border: 1.5px solid var(--brand); border-radius: var(--radius-sm); padding: 8px 14px; font-family: var(--font-body); font-size: 0.84rem; font-weight: 700; cursor: pointer; }
.hb-alert-btn:hover { background: var(--brand-wash); }
.hb-alert-btn.on { background: var(--brand); color: #fff; }
.hb-more { color: var(--brand-bright); font-weight: 600; font-size: 0.84rem; text-decoration: underline; }
.hb-hint { margin: 8px 0 0; font-size: 0.76rem; color: var(--ink-faint); }
.hb-stamp { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.18); font-size: 0.74rem; color: rgba(255,255,255,0.78); line-height: 1.7; }
.hb-toast { position: fixed; z-index: 95; top: 86px; inset-inline: 0; margin-inline: auto; width: min(92vw, 480px); background: var(--brand); color: #fff; border-radius: var(--radius-md); padding: 14px 40px 14px 16px; box-shadow: var(--shadow-lg); border-top: 3px solid var(--gold-bright); font-size: 0.86rem; line-height: 1.7; }
.hb-toast a { color: var(--gold-bright); font-weight: 700; text-decoration: underline; }
.hb-toast-x { position: absolute; top: 6px; inset-inline-end: 8px; background: none; border: 0; color: #fff; font-size: 1.3rem; cursor: pointer; }
@media print { .hb-badge .hb-actions, .hb-hint, .hb-toast { display: none !important; } }

#accountLink { white-space: nowrap; }

/* قائمة «المقارنات» في الهيدر */
.nav-menu { position: relative; }
.nav-menu summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink); font-weight: 600; font-size: 0.94rem; padding: 10px 14px; border-bottom: 3px solid transparent;
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary:hover, .nav-menu[open] summary { color: var(--brand-bright); border-bottom-color: var(--brand-bright); }
.nav-menu[open] summary svg { transform: rotate(180deg); }
.nav-menu-panel {
  position: absolute; top: 100%; inset-inline-start: 0; z-index: 50; min-width: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: 6px;
}
nav.main-nav .nav-menu-panel a { display: block; padding: 10px 12px; border: 0; border-radius: var(--radius-sm); font-size: 0.9rem; }
nav.main-nav .nav-menu-panel a:hover { background: var(--brand-wash); }
@media (max-width: 1024px) {
  .nav-menu { width: 100%; border-bottom: 1px solid var(--line); }
  .nav-menu summary { width: 100%; justify-content: space-between; padding: 13px 4px; border-bottom: 0; }
  .nav-menu-panel { position: static; box-shadow: none; border: 0; padding: 0 8px 8px; }
}

/* نافذة تفاصيل الاسترداد */
dialog.redeem-dialog { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(94vw, 560px); max-height: 90vh; box-shadow: var(--shadow-lg); color: var(--ink); }
dialog.redeem-dialog::backdrop { background: rgba(6, 27, 53, 0.55); }
.redeem-dialog .body { padding: 22px; overflow-y: auto; max-height: 86vh; }
.redeem-dialog h3 { margin: 0 0 4px; color: var(--brand); font-size: 1.1rem; }
.redeem-dialog .quote { background: var(--surface-soft); border-inline-start: 3px solid var(--brand-bright); border-radius: var(--radius-sm); padding: 12px 14px; margin: 12px 0; line-height: 1.8; font-size: 0.92rem; }
.redeem-dialog ul { padding-inline-start: 20px; margin: 8px 0; font-size: 0.88rem; line-height: 1.8; color: var(--ink-soft); }
.redeem-dialog .warn { background: var(--gold-wash); color: #7A5310; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.86rem; line-height: 1.7; }
.redeem-dialog .close-row { display: flex; justify-content: flex-end; margin-top: 14px; }
.redeem-explain { font-size: 0.84rem; line-height: 1.8; color: var(--ink-soft); }
.redeem-explain ul { padding-inline-start: 20px; margin: 6px 0 10px; }

/* الهيدر فيه 6 روابط: من غير التفاف، ومسافات أضيق على الشاشات المتوسطة */
nav.main-nav a, .nav-dropdown-toggle, .nav-menu summary { white-space: nowrap; }
@media (min-width: 1025px) and (max-width: 1240px) {
  .site-header .bar { gap: 14px; }
  nav.main-nav a, .nav-dropdown-toggle, .nav-menu summary { padding-inline: 8px; font-size: 0.88rem; }
  .brand-name { font-size: 1.4rem; }
}
.nav-menu summary.active { color: var(--brand-bright); border-bottom-color: var(--brand-bright); }
nav.main-nav .nav-menu-panel a.active { color: var(--brand-bright); font-weight: 700; }

/* قائمة المستخدم في الهيدر */
.user-menu { position: relative; flex-shrink: 0; }
.user-chip {
  list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 4px 10px 4px 4px; border: 1px solid var(--line-strong); border-radius: 999px;
  font-weight: 600; font-size: 0.9rem; color: var(--ink); background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.user-chip::-webkit-details-marker { display: none; }
.user-chip:hover, .user-menu[open] .user-chip { border-color: var(--brand-bright); box-shadow: 0 0 0 3px rgba(11, 98, 184, 0.10); }
.user-menu[open] .user-chip > svg { transform: rotate(180deg); }
.user-chip .u-first { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .user-chip .u-first { display: none; } }
.avatar { position: relative; display: grid; place-items: center; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--brand); color: #fff; }
.avatar.sm { width: 30px; height: 30px; font-size: 0.78rem; }
.avatar.lg { width: 44px; height: 44px; font-size: 1rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar .av-ini { display: none; font-weight: 700; font-family: var(--font-display); }
.avatar.no-img .av-ini { display: block; }
.user-panel {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 60; width: 270px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(6, 27, 53, 0.16); padding: 8px;
}
.user-panel .u-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.user-panel .u-id { min-width: 0; display: flex; flex-direction: column; }
.user-panel .u-id b { font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-panel .u-id small { color: var(--ink-soft); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: end; }
.user-panel a, .user-panel button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 9px;
  color: var(--ink); font: 500 0.9rem var(--font-body); background: none; border: 0; cursor: pointer; text-align: start;
}
.user-panel a:hover, .user-panel button:hover { background: var(--brand-wash); color: var(--brand); text-decoration: none; }
.user-panel .u-logout { color: var(--cost); margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; }
.user-panel .u-logout:hover { background: var(--cost-wash); color: var(--cost); }

/* كروت البطاقات الائتمانية: ارتفاع موحد + شبكة مؤشرات بعمودين + تذييل للشارات */
.crd-grid { grid-auto-rows: 1fr; align-items: stretch; }
.crd-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; height: 100%; box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px;
  box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .15s, border-color .15s;
}
.crd-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.crd-card.best { border: 1.5px solid var(--gold-bright); padding-top: 46px; }
.crd-ribbon {
  position: absolute; top: 0; inset-inline: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 12px; border-radius: 15px 15px 0 0; font-weight: 700; font-size: 0.82rem;
  background: linear-gradient(90deg, var(--gold-wash), #FCEBC4); color: #7A5310; border-bottom: 1px solid rgba(169, 118, 31, 0.25);
}
.crd-ribbon svg { color: var(--gold); }
.crd-head .bank { margin-bottom: 8px; }
.crd-name { margin: 0; font-size: 1.05rem; color: var(--ink); line-height: 1.4; }
.crd-highlight {
  margin: 4px 0 0; color: var(--ink-soft); font-size: 0.84rem; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.2em;
}
.crd-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.crd-metric {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; row-gap: 2px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; min-width: 0;
}
.crd-ico { grid-row: 1 / 3; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-wash); color: var(--brand); }
.crd-metric.warn .crd-ico { background: var(--cost-wash); color: var(--cost); }
.crd-label { font-size: 0.74rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crd-value { font-family: var(--font-mono); font-size: 0.9rem; color: var(--ink); line-height: 1.35; overflow-wrap: anywhere; }
.crd-value small { font-family: var(--font-body); font-size: 0.72rem; color: var(--ink-soft); font-weight: 500; }
.crd-unknown { font-family: var(--font-body); font-size: 0.8rem; font-weight: 500; color: var(--ink-faint); border-bottom: 1px dotted var(--ink-faint); cursor: help; }
.crd-more {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  background: none; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 9px 12px;
  font: 600 0.85rem var(--font-body); color: var(--brand-bright); cursor: pointer; transition: background .15s, border-color .15s;
}
.crd-more:hover:not(:disabled) { background: var(--brand-wash); border-color: var(--brand-bright); }
.crd-more:disabled { color: var(--ink-faint); cursor: default; }
.crd-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.crd-foot .badges { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crd-foot .badge { font-size: 0.72rem; }
.crd-date { font-size: 0.72rem; color: var(--ink-faint); }
.crd-plans { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.crd-plans th { background: var(--surface-soft); text-align: start; padding: 7px 10px; font-weight: 600; }
.crd-plans td { padding: 7px 10px; border-top: 1px solid var(--line); }
@media (max-width: 360px) { .crd-metrics { grid-template-columns: 1fr; } }

/* هيكل تحميل (Skeleton) لصفحات التطبيق اللي بتجيب بياناتها بـ JS (المحل ولوحة الحسابات) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skel { display: grid; gap: 14px; }
.skel i { display: block; height: 44px; border-radius: 12px; background: linear-gradient(90deg, var(--surface-soft), #F6F8FB, var(--surface-soft)); background-size: 200% 100%; animation: skel-shimmer 1.2s infinite; }
.skel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.skel-grid i { height: 86px; }
@keyframes skel-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel i { animation: none; } }
.load-fail { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* شارة «قريباً» للأقسام المقفولة مؤقتاً (COMING_SOON_SECTIONS) — في التنقل والكروت والأزرار */
.soon-badge { display: inline-block; vertical-align: middle; margin-inline-start: 6px; padding: 1px 9px; border-radius: 999px;
  background: var(--gold-wash); color: var(--gold); font-family: var(--font-display); font-size: 0.72rem; font-weight: 700;
  line-height: 1.7; white-space: nowrap; }
.btn .soon-badge { background: rgba(255, 255, 255, 0.85); }
