  :root {
    --navy-deep: #081426;
    --navy: #0e2140;
    --navy-card: #13294d;
    --navy-card-2: #18325c;
    --hairline: rgba(255,255,255,.09);
    --gold: #e7c25a;
    --gold-soft: #f4dd9a;
    --gold-deep: #b98f2a;
    --ink: #f2f5fb;
    --ink2: #b3c2dc;
    --ink3: #93a7c6;
    --red: #ff6b74;
    --green: #43d98a;
    --amber: #ffb14d;
  }
  * { box-sizing: border-box; margin: 0; }
  html { -webkit-text-size-adjust: 100%; }
  body {
    background: var(--navy-deep);
    color: var(--ink);
    font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
    min-height: 100vh;
    background-image:
      radial-gradient(900px 500px at 85% -10%, rgba(231,194,90,.10), transparent 60%),
      radial-gradient(700px 420px at 5% 0%, rgba(45,90,180,.18), transparent 60%);
    background-attachment: fixed;
    padding: 0 12px 40px;
  }
  main { max-width: 680px; margin: 0 auto; }

  /* حركة دخول ناعمة */
  @keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  .rise { animation: riseIn .55s cubic-bezier(.2,.7,.25,1) both; }

  /* الترويسة */
  header.top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 22px 6px 18px;
  }
  .brand { display: flex; align-items: center; gap: 12px; }
  .brand .mark {
    width: 44px; height: 44px; border-radius: 14px; flex: none;
    background: linear-gradient(145deg, var(--gold-soft), var(--gold) 45%, var(--gold-deep));
    display: grid; place-items: center;
    box-shadow: 0 6px 18px rgba(231,194,90,.28), inset 0 1px 0 rgba(255,255,255,.55);
  }
  .brand .mark svg { width: 24px; height: 24px; }
  .brand h1 { font-size: 19px; font-weight: 800; line-height: 1.35; }
  .brand .tagline { color: var(--ink2); font-size: 12px; font-weight: 400; }
  .live-pill {
    display: flex; align-items: center; gap: 7px; flex: none;
    border: 1px solid var(--hairline); border-radius: 999px;
    padding: 7px 13px; font-size: 12px; color: var(--ink2);
    background: rgba(255,255,255,.03);
  }
  .live-pill .dot {
    width: 8px; height: 8px; border-radius: 50%; flex: none;
    background: var(--gold);
    box-shadow: 0 0 0 0 rgba(231,194,90,.5);
    animation: pulseDot 2.2s ease-out infinite;
  }
  @keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(231,194,90,.45); }
    70% { box-shadow: 0 0 0 8px rgba(231,194,90,0); }
    100% { box-shadow: 0 0 0 0 rgba(231,194,90,0); }
  }
  .live-pill.warn .dot { background: var(--amber); animation: none; }
  .updated { color: var(--ink3); font-size: 12px; padding: 0 6px; margin-bottom: 14px; }

  /* تنبيه فشل الجلب */
  .fail-banner {
    display: none;
    border: 1px solid rgba(255,107,116,.45);
    background: linear-gradient(160deg, rgba(255,107,116,.14), rgba(255,107,116,.05));
    border-radius: 16px; padding: 13px 16px; margin-bottom: 16px;
    font-size: 12.5px; line-height: 1.9; color: #ffd7da;
  }
  .fail-banner.show { display: block; animation: riseIn .4s ease both; }
  .fail-banner b { color: var(--red); }

  /* البطاقة الرئيسية */
  .hero {
    position: relative; overflow: hidden;
    border: 1px solid rgba(231,194,90,.35);
    border-radius: 22px;
    background:
      radial-gradient(420px 200px at 88% -20%, rgba(231,194,90,.22), transparent 65%),
      linear-gradient(160deg, var(--navy-card-2), var(--navy-card) 60%, #0f2347);
    padding: 24px 20px 20px;
    text-align: center;
    margin-bottom: 26px;
    box-shadow: 0 18px 40px rgba(0,0,0,.35);
  }
  .hero::after {
    content: ""; position: absolute; inset: 10px;
    border: 1px solid rgba(231,194,90,.14); border-radius: 16px; pointer-events: none;
  }
  .hero .label { color: var(--ink2); font-size: 13px; font-weight: 600; margin-bottom: 8px; }
  .hero .value-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
  .hero .value {
    font-size: 56px; font-weight: 900; line-height: 1.1; letter-spacing: -.01em;
    background: linear-gradient(180deg, var(--gold-soft), var(--gold) 55%, var(--gold-deep));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: 0 10px 30px rgba(231,194,90,.12);
    font-variant-numeric: tabular-nums;
  }
  .hero .unit { color: var(--gold); font-size: 17px; font-weight: 700; }
  .hero .sub { color: var(--ink2); font-size: 13px; margin-top: 8px; }
  .hero .sub2 { color: var(--ink3); font-size: 12px; margin-top: 4px; }
  .hero .sparkline { margin: 12px auto 2px; display: block; }
  .hero .hilo { color: var(--ink3); font-size: 11.5px; margin-top: 6px; }

  /* شارات الاتجاه */
  .chip {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px; font-weight: 800; line-height: 1;
    border-radius: 999px; padding: 5px 9px;
    font-variant-numeric: tabular-nums; white-space: nowrap;
  }
  .chip.up { color: var(--green); background: rgba(67,217,138,.10); border: 1px solid rgba(67,217,138,.30); }
  .chip.down { color: var(--red); background: rgba(255,107,116,.10); border: 1px solid rgba(255,107,116,.30); }
  .chip.flat { color: var(--ink3); background: rgba(255,255,255,.04); border: 1px solid var(--hairline); }

  /* عناوين الأقسام */
  .section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 4px 10px; }
  h2 { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
  h2::before {
    content: ""; width: 4px; height: 20px; border-radius: 2px; flex: none;
    background: linear-gradient(180deg, var(--gold-soft), var(--gold-deep));
  }
  .section-label { color: var(--ink3); font-size: 11.5px; text-align: left; }

  /* البطاقات */
  ul { list-style: none; padding: 0; margin-bottom: 28px; display: grid; gap: 9px; }
  li {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 12px;
    background: linear-gradient(150deg, var(--navy-card), #102345);
    border: 1px solid var(--hairline);
    border-radius: 16px;
    padding: 13px 15px;
    transition: transform .15s ease, border-color .2s ease;
  }
  li:hover { transform: translateY(-2px); border-color: rgba(231,194,90,.30); }
  li::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    opacity: 0; border-radius: inherit;
  }
  li.flash-up::before {
    background: linear-gradient(90deg, rgba(67,217,138,.20), transparent 70%);
    animation: flashFade 1.6s ease-out;
  }
  li.flash-down::before {
    background: linear-gradient(90deg, rgba(255,107,116,.20), transparent 70%);
    animation: flashFade 1.6s ease-out;
  }
  @keyframes flashFade { 0% { opacity: 1; } 100% { opacity: 0; } }
  .code-badge {
    flex: none; width: 46px; height: 46px; border-radius: 13px;
    display: grid; place-items: center;
    font-size: 12.5px; font-weight: 800; letter-spacing: .02em;
    color: var(--gold-soft);
    background: rgba(231,194,90,.09);
    border: 1px solid rgba(231,194,90,.25);
  }
  #gold .code-badge { border-radius: 50%; }
  .name { font-weight: 700; font-size: 14.5px; flex: 1; min-width: 0; line-height: 1.55; }
  .detail { color: var(--ink2); font-size: 11.5px; font-weight: 400; }
  .spark { flex: none; width: 56px; height: 24px; opacity: .9; }
  .price-col { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
  .price {
    font-weight: 800; font-size: 16px; white-space: nowrap; color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  .price small { color: var(--ink3); font-size: 11px; font-weight: 600; }
  main.live .price { color: #fff; }

  /* الحاسبات */
  .calc-grid-2 { display: grid; gap: 14px; margin-bottom: 28px; }
  .calc {
    border: 1px solid rgba(231,194,90,.22);
    background: linear-gradient(160deg, var(--navy-card), #101f3e);
    border-radius: 18px; padding: 17px;
  }
  .calc h3 { font-size: 15px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
  .calc h3::before {
    content: ""; width: 3px; height: 16px; border-radius: 2px;
    background: linear-gradient(180deg, var(--gold-soft), var(--gold-deep));
  }
  .calc .fields { display: grid; gap: 9px; }
  .calc label { display: grid; gap: 5px; color: var(--ink3); font-size: 11.5px; font-weight: 600; }
  .calc input, .calc select {
    width: 100%; background: rgba(255,255,255,.05);
    border: 1px solid var(--hairline); border-radius: 11px;
    color: var(--ink); font-family: inherit; font-size: 15px; font-weight: 700;
    padding: 10px 12px; outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    font-variant-numeric: tabular-nums;
  }
  .calc select option { background: var(--navy-card); color: var(--ink); }
  .calc input:focus, .calc select:focus { border-color: rgba(231,194,90,.5); box-shadow: 0 0 0 3px rgba(231,194,90,.12); }
  .calc .two { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .calc-result {
    margin-top: 13px; padding: 13px 14px; border-radius: 13px;
    background: rgba(231,194,90,.08); border: 1px solid rgba(231,194,90,.22);
    font-size: 17px; font-weight: 900; color: var(--gold-soft);
    font-variant-numeric: tabular-nums; line-height: 1.7;
  }
  .calc-result .pair { display: block; }
  .calc-note { color: var(--ink3); font-size: 11px; margin-top: 8px; line-height: 1.8; }

  /* التحديث اليدوي والحالة */
  .refresh {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--hairline);
    border-radius: 18px; padding: 16px; margin-bottom: 20px;
    text-align: center;
  }
  .refresh .row { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
  button {
    background: linear-gradient(160deg, var(--gold-soft), var(--gold) 55%, var(--gold-deep));
    color: #2b2005; border: 0; border-radius: 12px;
    padding: 12px 30px; font-size: 15px; font-weight: 800; font-family: inherit;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(231,194,90,.28), inset 0 1px 0 rgba(255,255,255,.6);
    transition: transform .12s ease, box-shadow .2s ease;
  }
  button:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(231,194,90,.34), inset 0 1px 0 rgba(255,255,255,.6); }
  button:active { transform: translateY(0) scale(.98); }
  button:disabled { opacity: .55; cursor: default; transform: none; }
  .countdown { display: inline-flex; align-items: center; gap: 8px; color: var(--ink3); font-size: 12px; }
  .countdown svg { width: 30px; height: 30px; transform: rotate(-90deg); }
  .countdown .ring-bg { stroke: rgba(255,255,255,.10); }
  .countdown .ring-fg { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .9s linear; }
  .status { color: var(--ink2); font-size: 12px; margin-top: 12px; line-height: 1.9; }
  .status.error { color: var(--red); }

  /* التنبيه والتذييل */
  .note {
    background: rgba(231,194,90,.06);
    border: 1px solid rgba(231,194,90,.18);
    border-radius: 16px; padding: 15px 17px;
    font-size: 12.5px; line-height: 2; color: var(--ink2);
    margin-bottom: 18px;
  }
  .note b { display: block; margin-bottom: 2px; color: var(--gold); font-size: 13px; }
  footer { color: var(--ink3); font-size: 11.5px; line-height: 2; padding: 0 4px; }
  footer a { color: var(--gold); text-decoration: none; border-bottom: 1px dotted rgba(231,194,90,.4); }

  @media (min-width: 640px) {
    body { padding: 0 20px 48px; }
    header.top { padding-top: 30px; }
    .brand h1 { font-size: 22px; }
    .hero .value { font-size: 64px; }
    .calc-grid-2 { grid-template-columns: 1fr 1fr; }
    .spark { width: 72px; height: 26px; }
  }
  @media (max-width: 420px) {
    .spark { display: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
  }

.src-note{font-size:.68rem;opacity:.75;margin:.3rem 0 .2rem;line-height:1.5}
.src-note a{text-decoration:underline}
.src-note a{color:#e7c25a;font-weight:500}
