:root {
  --palm: #174532;
  --forest: #102E22;
  --sand: #D7C39A;
  --ivory: #F8F5ED;
  --gold: #B89A58;
  --gold-deep: #6E5428;
  --white: #ffffff;
  --ink: #1c2420;
  --muted: #5d6b64;
  --line: #e4dccb;
  --card: #fffcf7;
  --danger: #8c3a32;
  --ok: #1f6b45;
  --warn: #8a6230;
  --info: #245c6b;
  --shadow: 0 18px 40px rgba(16, 46, 34, 0.08);
  --radius: 18px;
  --header: 76px;
  --serif-num: "Inter", "Cairo", sans-serif;
  --font: "Cairo", "IBM Plex Sans Arabic", "Segoe UI", sans-serif;
  --max: 1160px;
  --ease: 180ms ease;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.85;
  font-size: 1.05rem;
}

img { max-width: 100%; display: block; }

a { color: var(--palm); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--forest); }

button, input, select, textarea { font-family: inherit; font-size: 1rem; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -40px;
  background: var(--forest);
  color: white;
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { top: 12px; }

.num, .ltr { font-family: var(--serif-num); direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(248, 245, 237, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  height: var(--header);
}

.header-inner, .footer-grid, .hero-grid, .split, .stat-grid, .card-grid, .dash-grid {
  display: grid;
  gap: 22px;
}

.header-inner {
  height: var(--header);
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--forest); }
.brand img { width: 44px; height: 44px; }
.brand-ar { display: block; font-weight: 700; font-size: 1.25rem; line-height: 1.2; }
.brand-en { display: block; font-family: var(--serif-num); font-size: 0.68rem; letter-spacing: 0.14em; color: var(--gold-deep); }

.nav { display: flex; gap: 18px; justify-content: center; align-items: center; }
.nav a { text-decoration: none; color: var(--forest); font-weight: 600; font-size: 0.98rem; }
.nav a[aria-current="page"] { color: var(--gold-deep); }

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

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 8px 12px;
  color: var(--forest);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 18px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.2;
}
.btn-primary { background: var(--palm); color: white; }
.btn-primary:hover { background: var(--forest); color: white; }
.btn-secondary { background: transparent; color: var(--forest); border-color: var(--sand); }
.btn-secondary:hover { border-color: var(--forest); color: var(--forest); }
.btn-gold { background: var(--sand); color: var(--forest); }
.btn-ghost { background: transparent; color: var(--ivory); border-color: rgba(215, 195, 154, 0.45); }
.btn-small { padding: 8px 12px; font-size: 0.92rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.hero { padding: 42px 0 20px; }
.hero-grid { grid-template-columns: 1.05fr 0.95fr; align-items: center; }
.kicker {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--gold-deep);
  font-weight: 700;
  margin-bottom: 8px;
}
.kicker::before { content: ""; width: 28px; height: 1px; background: var(--gold); }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.35; margin: 0 0 10px; color: var(--forest); }
h1 { font-size: clamp(2rem, 4vw, 3.35rem); }
h2 { font-size: clamp(1.55rem, 2.4vw, 2.15rem); }
h3 { font-size: 1.25rem; }
.lede { font-size: 1.18rem; color: #31423b; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero-figure {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  min-height: 420px;
  box-shadow: var(--shadow);
}
.hero-figure img { width: 100%; height: 100%; object-fit: cover; min-height: 420px; }
.caption {
  position: absolute;
  inset-inline: 12px;
  bottom: 12px;
  background: rgba(16, 46, 34, 0.82);
  color: var(--ivory);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.86rem;
}

.section { padding: 56px 0; }
.section-head { max-width: 720px; margin-bottom: 22px; }
.muted { color: var(--muted); }
.center { text-align: center; }

.card, .palm-card, .panel, .faq details, .table-wrap, .form, .stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset;
}
.card, .panel, .form { padding: 20px; }
.card-grid { grid-template-columns: repeat(3, 1fr); }
.card-grid.two { grid-template-columns: repeat(2, 1fr); }
.steps { counter-reset: step; display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.step::before {
  counter-increment: step;
  content: counter(step);
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: var(--sand);
  font-family: var(--serif-num);
}

.stat-grid { grid-template-columns: repeat(4, 1fr); }
.stat { padding: 16px; }
.stat b { display: block; font-size: 1.35rem; color: var(--forest); }
.empty-note {
  border: 1px dashed var(--sand);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(215, 195, 154, 0.18);
}

.palm-card { overflow: hidden; display: flex; flex-direction: column; }
.palm-card img, .ph { height: 180px; object-fit: cover; width: 100%; }
.ph {
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(184, 154, 88, 0.35), transparent 42%),
    linear-gradient(180deg, #1d533d, #102E22);
  color: var(--sand);
  font-weight: 700;
}
.palm-card .body, .pad { padding: 14px 16px 16px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #e7efe9;
  color: var(--palm);
}
.badge.warn { background: #f6ecda; color: var(--warn); }
.badge.danger { background: #f8e8e6; color: var(--danger); }
.badge.neutral { background: #eeeae2; color: #4d463c; }
.badge.ok { background: #e5f4eb; color: var(--ok); }
.badge.info { background: #e5f1f4; color: var(--info); }

.price { font-size: 1.25rem; color: var(--forest); font-weight: 700; }

.split { grid-template-columns: 1.1fr 0.9fr; align-items: center; }
.frame { border-radius: 24px; overflow: hidden; border: 1px solid var(--line); }
.frame img { width: 100%; height: 100%; object-fit: cover; max-height: 460px; }

.fee-table, table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--forest); font-weight: 700; background: #f3eee4; }
.table-wrap { overflow-x: auto; }

.gallery { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.gallery .stack { display: grid; gap: 12px; }
.gallery figure { margin: 0; position: relative; border-radius: 20px; overflow: hidden; }
.gallery img { width: 100%; height: 100%; object-fit: cover; min-height: 180px; }

.band {
  background: var(--forest);
  color: var(--ivory);
  border-radius: 28px;
  padding: 28px;
}
.band h2, .band h3 { color: white; }
.band p { color: #e7e1d4; }

.risk {
  border-inline-start: 4px solid var(--gold);
  background: #fff;
  padding: 16px 18px;
  border-radius: 12px;
}

details.faq { padding: 0; margin-bottom: 10px; }
details.faq summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--forest);
  list-style: none;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "＋"; float: left; color: var(--gold-deep); }
details.faq[open] summary::after { content: "–"; }
details.faq .answer { padding: 0 16px 14px; color: #31423b; }

.site-footer { background: var(--forest); color: #e6e0d4; margin-top: 40px; padding: 42px 0 20px; }
.site-footer a { color: var(--sand); text-decoration: none; }
.footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.site-footer h3 { color: white; font-size: 1rem; }
.legal-line { border-top: 1px solid rgba(215,195,154,.25); margin-top: 22px; padding-top: 12px; font-size: 0.92rem; color: #cbbfa6; }

.form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-weight: 700; color: var(--forest); }
input, select, textarea {
  width: 100%;
  border: 1px solid #ddd4c4;
  background: white;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
.help { font-weight: 500; color: var(--muted); font-size: 0.88rem; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; }
.check input { width: auto; margin-top: 6px; }

.banner {
  background: #f4ead4;
  color: #3e3424;
  border-bottom: 1px solid var(--sand);
  padding: 8px 16px;
  text-align: center;
  font-weight: 700;
}
.banner.demo { background: #efe4c6; }
.draft-banner {
  background: #fff7ea;
  border: 1px solid var(--sand);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.results dt { color: var(--muted); }
.results dd { margin: 0 0 10px; font-weight: 700; color: var(--forest); font-size: 1.15rem; }
.formula { background: #f7f3ea; border-radius: 12px; padding: 12px; font-size: 0.95rem; }

.chart-box { min-height: 240px; position: relative; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.app-body { margin: 0; background: #f3efe6; min-height: 100vh; }
.app-shell { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--forest);
  color: #efe8da;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.sidebar a { color: #efe8da; text-decoration: none; display: block; padding: 8px 10px; border-radius: 10px; }
.sidebar a[aria-current="page"], .sidebar a:hover { background: rgba(215, 195, 154, 0.16); }
.side-label { color: var(--sand); font-size: 0.78rem; margin: 16px 10px 6px; }
.app-main { padding: 18px; }
.app-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.widget-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.tabs button { border: 1px solid var(--line); background: white; border-radius: 999px; padding: 6px 10px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--forest); color: white; }
.notice { padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.toast {
  position: fixed; bottom: 16px; inset-inline-start: 16px; background: var(--forest); color: white;
  padding: 12px 14px; border-radius: 12px; z-index: 50; max-width: min(420px, calc(100% - 32px));
}
.modal-back {
  position: fixed; inset: 0; background: rgba(16, 46, 34, 0.46); display: grid; place-items: center; z-index: 40; padding: 16px;
}
.modal { background: white; border-radius: 18px; max-width: 640px; width: 100%; padding: 16px; max-height: min(86vh, 820px); overflow: auto; }
.auth-card { width: min(480px, calc(100% - 28px)); margin: 48px auto; }
.qr-card { width: 320px; border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: white; }
.qr-card canvas, .qr-card img { margin: 8px auto; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.filters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }

@media (max-width: 980px) {
  .hero-grid, .split, .card-grid, .card-grid.two, .calc-grid, .footer-grid, .gallery, .stat-grid, .widget-grid, .app-shell {
    grid-template-columns: 1fr;
  }
  .nav { display: none; }
  .nav.open {
    display: grid;
    position: absolute;
    inset-inline: 0;
    top: var(--header);
    background: var(--ivory);
    border-bottom: 1px solid var(--line);
    padding: 12px 16px 16px;
    gap: 8px;
  }
  .menu-toggle { display: inline-flex; }
  .header-inner { grid-template-columns: auto auto; }
  .header-actions .btn-secondary { display: none; }
  .sidebar { position: relative; height: auto; }
  .filters { grid-template-columns: 1fr 1fr; }
  .hero-figure, .hero-figure img { min-height: 260px; }
}

@media (max-width: 640px) {
  .stat-grid, .widget-grid, .filters { grid-template-columns: 1fr; }
  .cta-row .btn { width: 100%; }
  h1 { font-size: 1.85rem; }
}

@media print {
  .site-header, .site-footer, .sidebar, .no-print, .banner { display: none !important; }
  body, .app-body { background: white; }
  .app-shell { display: block; }
  a { text-decoration: none; color: black; }
}
