:root {
  --dei-green: #0E8C4F;
  --dei-green-dark: #09451e;
  --dei-green-soft: #e8f5ee;
  --dei-ink: #1a2420;
  --dei-muted: #6b7a72;
  --dei-line: #d7e5dd;
  --dei-surface: #ffffff;
  --dei-radius: 14px;
  --dei-shadow: 0 8px 24px rgba(14, 140, 79, 0.08);
  --dei-nav-h: 58px;
}

html {
  scroll-behavior: smooth;
}

body.dei-body {
  margin: 0;
  direction: rtl;
  color: var(--dei-ink);
  background:
    radial-gradient(1200px 480px at 100% -10%, rgba(14, 140, 79, 0.12), transparent 55%),
    linear-gradient(180deg, #f3faf6 0%, #eef3f0 45%, #f7f8f7 100%);
  font-family: "Tajawal", "Droid Arabic Kufi", sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

body.dei-body h1,
body.dei-body h2,
body.dei-body h3,
body.dei-body h4,
body.dei-body h5,
body.dei-body p,
body.dei-body a,
body.dei-body button,
body.dei-body li,
body.dei-body select,
body.dei-body td {
  font-family: "Tajawal", "Droid Arabic Kufi", sans-serif !important;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Top nav ---------- */
.dei-nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 1000;
  height: var(--dei-nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--dei-green) 0%, var(--dei-green-dark) 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(9, 69, 30, 0.22);
}

.dei-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dei-brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: #fff;
}

.dei-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.dei-brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.dei-brand-tag {
  font-size: 0.72rem;
  opacity: 0.88;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
}

.dei-nav-desktop {
  display: none;
  align-items: center;
  gap: 2px;
}

.dei-nav-link {
  color: #fff !important;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.2s ease;
}

.dei-nav-link:hover,
.dei-nav-link.is-active {
  background: rgba(255, 255, 255, 0.16);
}

.dei-nav-dropdown {
  position: relative;
}

.dei-nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: #fff;
  color: var(--dei-ink);
  border-radius: 12px;
  box-shadow: var(--dei-shadow);
  overflow: hidden;
  z-index: 20;
}

.dei-nav-dropdown:hover .dei-nav-dropdown-menu {
  display: block;
}

.dei-nav-dropdown-menu a {
  display: block;
  padding: 10px 14px;
  color: var(--dei-ink) !important;
  border-bottom: 1px solid #eef3f0;
}

.dei-nav-dropdown-menu a:hover {
  background: var(--dei-green-soft);
  color: var(--dei-green-dark) !important;
}

.dei-menu-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.dei-menu-btn:active {
  transform: scale(0.96);
}

/* ---------- Mobile drawer ---------- */
.dei-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 28, 18, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1100;
}

.dei-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: min(86vw, 320px);
  background: linear-gradient(180deg, var(--dei-green) 0%, var(--dei-green-dark) 100%);
  color: #fff;
  z-index: 1200;
  transform: translateX(105%);
  transition: transform 0.28s ease;
  padding: 18px 14px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

body.dei-nav-open .dei-drawer {
  transform: translateX(0);
}

body.dei-nav-open .dei-drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.dei-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.dei-drawer-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.dei-drawer a,
.dei-drawer .dei-drawer-label {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  color: #fff !important;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
}

.dei-drawer a:hover {
  background: rgba(255, 255, 255, 0.16);
}

.dei-drawer-sub {
  margin: 0 8px 8px;
  padding-right: 8px;
  border-right: 2px solid rgba(255, 255, 255, 0.25);
}

.dei-drawer-sub a {
  font-weight: 500;
  font-size: 0.92rem;
  background: transparent;
  padding: 8px 10px;
}

/* ---------- Page shell ---------- */
.dei-main {
  min-height: 60vh;
  padding-top: calc(var(--dei-nav-h) + 12px);
}

.dei-home {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 12px 28px;
}

.dei-home-hero {
  margin: 4px 0 14px;
  animation: dei-fade-up 0.45s ease both;
}

.dei-home-hero h1 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--dei-green-dark);
}

.dei-home-hero p {
  margin: 0;
  color: var(--dei-muted);
  font-size: 0.92rem;
}

/* ---------- Ticker ---------- */
.dei-ticker {
  overflow: hidden;
  margin: 0 0 16px;
  border-radius: var(--dei-radius);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--dei-line);
  box-shadow: var(--dei-shadow);
  animation: dei-fade-up 0.5s ease 0.05s both;
}

.dei-ticker-track {
  display: flex;
  direction: ltr;
  width: max-content;
  gap: 10px;
  padding: 10px;
  animation: dei-ticker 38s linear infinite;
}

.dei-ticker:hover .dei-ticker-track {
  animation-play-state: paused;
}

.dei-ticker-item {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--dei-surface);
  border: 1px solid var(--dei-line);
  text-align: center;
}

.dei-ticker-value {
  margin: 0;
  color: var(--dei-green);
  font-weight: 800;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.dei-ticker-code {
  margin: 2px 0 0;
  color: var(--dei-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

@keyframes dei-ticker {
  from { transform: translateX(0); }
  to { transform: translateX(50%); }
}

/* ---------- Sections / cards ---------- */
.dei-grid {
  display: grid;
  gap: 14px;
}

.dei-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--dei-line);
  border-radius: calc(var(--dei-radius) + 2px);
  box-shadow: var(--dei-shadow);
  overflow: hidden;
  animation: dei-fade-up 0.5s ease both;
}

.dei-panel:nth-child(2) { animation-delay: 0.08s; }
.dei-panel:nth-child(3) { animation-delay: 0.12s; }
.dei-panel:nth-child(4) { animation-delay: 0.16s; }

.dei-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--dei-green) 0%, #127a48 100%);
  color: #fff;
}

.dei-panel-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.dei-city-select {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='white' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat left 10px center;
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px 6px 28px;
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 110px;
  direction: rtl;
}

.dei-city-select option {
  color: var(--dei-ink);
}

.dei-panel-body {
  padding: 10px;
  display: grid;
  gap: 8px;
}

/* Price row */
.dei-price-row {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--dei-line);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

a:hover .dei-price-row,
a:focus-visible .dei-price-row {
  transform: translateY(-1px);
  border-color: rgba(14, 140, 79, 0.35);
  box-shadow: 0 10px 20px rgba(14, 140, 79, 0.1);
}

.dei-price-city {
  margin: 0;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--dei-ink);
}

.dei-price-time {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--dei-muted);
}

.dei-price-mid {
  text-align: center;
}

.dei-price-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1.02rem;
}

.dei-price-pair img {
  width: 22px;
  height: 22px;
}

.dei-price-prev {
  margin-top: 4px;
  display: flex;
  justify-content: center;
  gap: 14px;
  color: var(--dei-muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.dei-price-side {
  text-align: center;
  min-width: 58px;
}

.dei-price-chg {
  margin: 0;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--dei-green);
}

.dei-price-chg.is-down {
  color: #c0392b;
}

.dei-price-side img {
  width: 18px;
  margin-top: 4px;
}

/* Footer */
.dei-footer {
  margin-top: 28px;
  padding: 28px 16px 36px;
  text-align: center;
  color: #e8eee9;
  background:
    radial-gradient(600px 200px at 50% 0%, rgba(14, 140, 79, 0.35), transparent 70%),
    linear-gradient(180deg, #2d3531 0%, #1c2220 100%);
}

.dei-footer-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff !important;
  font-weight: 700;
  margin-bottom: 14px;
}

.dei-footer-social {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 1.35rem;
  margin-bottom: 12px;
}

.dei-footer-social a {
  color: #fff !important;
  opacity: 0.9;
}

.dei-footer p {
  margin: 6px 0;
  color: #c5cec8;
  font-size: 0.9rem;
}

.dei-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.dei-footer-links a {
  color: #dff5e8 !important;
  font-weight: 600;
}

@keyframes dei-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Desktop */
@media (min-width: 992px) {
  .dei-menu-btn {
    display: none;
  }

  .dei-nav-desktop {
    display: flex;
  }

  .dei-brand-tag {
    max-width: none;
  }

  .dei-home {
    padding: 0 20px 40px;
  }

  .dei-home-hero h1 {
    font-size: 1.7rem;
  }

  .dei-grid {
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
  }

  .dei-panel-span-2 {
    grid-column: span 1;
  }

  .dei-panel-lbp-try {
    display: grid;
    gap: 14px;
  }
}

@media (max-width: 991px) {
  .dei-nav-desktop {
    display: none !important;
  }
}

/* ---------- Shared pages ---------- */
.dei-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 12px 28px;
}

.dei-prose {
  color: var(--dei-ink);
  line-height: 1.85;
  font-size: 1rem;
}

.dei-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.dei-prose a {
  color: var(--dei-green) !important;
  font-weight: 700;
}

.dei-apps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 24px 12px !important;
}

.dei-app-badge img {
  max-width: 180px;
  height: auto;
}

.dei-form {
  display: grid;
  gap: 14px;
}

.dei-form-row {
  display: grid;
  gap: 14px;
}

.dei-field {
  display: grid;
  gap: 6px;
}

.dei-field span {
  font-weight: 700;
  color: var(--dei-muted);
  font-size: 0.9rem;
}

.dei-field input,
.dei-field textarea {
  width: 100%;
  border: 1px solid var(--dei-line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  color: var(--dei-ink);
  box-sizing: border-box;
}

.dei-field input:focus,
.dei-field textarea:focus {
  outline: 2px solid rgba(14, 140, 79, 0.25);
  border-color: var(--dei-green);
}

.dei-btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 22px;
  background: linear-gradient(135deg, var(--dei-green), var(--dei-green-dark));
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  width: fit-content;
}

.dei-alert {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-weight: 600;
}

.dei-alert-success {
  background: var(--dei-green-soft);
  color: var(--dei-green-dark);
}

.dei-alert-error {
  background: #fdecea;
  color: #a13228;
}

/* Blog */
.dei-blog-featured {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.dei-blog-hero,
.dei-blog-tile,
.dei-blog-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--dei-radius);
  border: 1px solid var(--dei-line);
  background: #111;
  min-height: 160px;
}

.dei-blog-hero img,
.dei-blog-tile img,
.dei-blog-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 160px;
  display: block;
  opacity: 0.92;
}

.dei-blog-hero {
  min-height: 220px;
}

.dei-blog-hero span,
.dei-blog-tile span,
.dei-blog-card span {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 12px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
}

.dei-blog-side {
  display: grid;
  gap: 10px;
}

.dei-blog-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.dei-blog-columns {
  display: grid;
  gap: 14px;
}

.dei-related-list {
  display: grid;
  gap: 8px;
}

.dei-related-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--dei-line);
  background: #fff;
}

.dei-related-item img {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}

.dei-related-item span {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.4;
}

.dei-related-title {
  margin: 0 0 10px;
  font-size: 1rem;
}

/* Article + history */
.dei-article-layout {
  display: grid;
  gap: 14px;
}

.dei-article-title {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--dei-green);
  color: var(--dei-ink);
  font-size: 1.35rem;
  font-weight: 800;
}

.dei-article-cover {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
}

.dei-range-tabs,
.dei-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.dei-range-tabs a,
.dei-tab {
  flex: 1 1 auto;
  text-align: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--dei-line);
  background: #fff;
  color: var(--dei-muted) !important;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.dei-range-tabs a.is-active,
.dei-tab.is-active,
.dei-tab.aw-tab {
  background: var(--dei-green-soft);
  border-color: rgba(14, 140, 79, 0.35);
  color: var(--dei-green-dark) !important;
}

.dei-chart {
  width: 100%;
  overflow: hidden;
}

.dei-pagination {
  margin-top: 16px;
  text-align: center;
}

@media (min-width: 768px) {
  .dei-form-row {
    grid-template-columns: 1fr 1fr;
  }

  .dei-blog-featured {
    grid-template-columns: 1.4fr 1fr;
  }

  .dei-blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .dei-blog-columns,
  .dei-article-layout {
    grid-template-columns: 1.6fr 1fr;
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dei-ticker-track,
  .dei-panel,
  .dei-home-hero,
  .dei-drawer,
  .dei-drawer-backdrop {
    animation: none !important;
    transition: none !important;
  }
}
