/* ==========================================================
   موج — التصميم العام (RTL)
   الفكرة: السوق كبحر؛ الموجة الأمامية في الواجهة هي سعر البيتكوين الحقيقي.
   ========================================================== */
:root {
  --abyss: #051526;
  --deep: #0a2540;
  --tide: #11385a;
  --foam: #e8f5f3;
  --mist: #8fb3c4;
  --mist-2: #5f8599;
  --glow: #37e2c9;
  --glow-2: #2bb8d9;
  --sun: #ffc15e;
  --up: #3be8a8;
  --down: #ff6b8a;
  --line: rgba(143, 179, 196, .14);
  --line-2: rgba(143, 179, 196, .24);
  --panel: rgba(17, 56, 90, .32);
  --panel-solid: #0c2b47;
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 9px;
  --font: "Readex Pro", system-ui, sans-serif;
  --display: "Alexandria", "Readex Pro", sans-serif;
  --max: 1240px;
  --gutter: 16px;
  --bar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: #030d18; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--foam);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(43, 184, 217, .18), transparent 60%),
    radial-gradient(900px 500px at 0% 30%, rgba(55, 226, 201, .07), transparent 60%),
    linear-gradient(180deg, #072038 0%, var(--abyss) 45%, #030d18 100%);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; border-radius: 6px; }
.num, .price, td.n, [data-num] { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--mist); }
.hidden { display: none !important; }

/* ---------- الشريط العلوي ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 21, 38, .78);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  height: 62px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 1.45rem; letter-spacing: -.01em; }
.brand-mark { width: 38px; height: 24px; fill: none; stroke: var(--glow); stroke-width: 3.2; stroke-linecap: round; }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a { padding: 7px 13px; border-radius: 999px; color: var(--mist); font-size: .95rem; transition: color .2s, background .2s; }
.mainnav a:hover { color: var(--foam); }
.mainnav a.is-active { color: var(--abyss); background: var(--glow); font-weight: 500; }
.topbar-side { display: flex; align-items: center; gap: 12px; margin-inline-start: auto; }
.live-dot { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--mist); }
.live-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--mist-2); }
.live-dot.on i { background: var(--up); box-shadow: 0 0 0 0 rgba(59, 232, 168, .6); animation: pulse 2s infinite; }
.live-dot.on b { color: var(--up); font-weight: 500; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(59, 232, 168, 0); } 100% { box-shadow: 0 0 0 0 rgba(59, 232, 168, 0); } }
.search-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; display: grid; place-items: center; }
.search-btn svg, .more-panel svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* شريط الأسعار المتحرك */
.ticker { overflow: hidden; border-top: 1px solid var(--line); height: 34px; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ticker-track { display: flex; gap: 34px; width: max-content; height: 34px; align-items: center; animation: tick 70s linear infinite; padding-inline: 20px; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(50%); } }
.tick-item { display: inline-flex; gap: 8px; align-items: baseline; font-size: .84rem; white-space: nowrap; }
.tick-item b { font-weight: 500; color: var(--foam); }
.tick-item .price { color: var(--mist); }

/* ---------- الصفحة ---------- */
.page { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 60px; }
.section { margin-top: 56px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(1.35rem, 2.4vw, 1.75rem); line-height: 1.3; }
.section-head p { margin: 4px 0 0; color: var(--mist); font-size: .95rem; }
.link-more { color: var(--glow); font-size: .93rem; white-space: nowrap; }
.link-more:hover { text-decoration: underline; text-underline-offset: 5px; }
.page-title { margin: 40px 0 6px; font-family: var(--display); font-weight: 800; font-size: clamp(1.9rem, 4.4vw, 2.9rem); line-height: 1.2; letter-spacing: -.01em; }
.page-lead { margin: 0 0 8px; color: var(--mist); max-width: 62ch; font-size: 1.05rem; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.panel h3 { margin: 0 0 14px; font-family: var(--display); font-weight: 700; font-size: 1.08rem; }

/* ---------- الواجهة / الأمواج ---------- */
.hero { position: relative; margin: 0 calc(-1 * var(--gutter)); padding: 56px var(--gutter) 0; min-height: 560px; overflow: hidden; isolation: isolate; }
.hero-inner { position: relative; z-index: 3; max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: start; }
.hero h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(2.3rem, 5.6vw, 4.3rem); line-height: 1.12; letter-spacing: -.02em; max-width: 13ch; }
.hero-sub { margin: 18px 0 26px; font-size: 1.12rem; color: var(--mist); max-width: 46ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-btc { justify-self: end; text-align: start; padding: 22px 24px; border-radius: var(--r-lg); background: rgba(5, 21, 38, .55); border: 1px solid var(--line-2); backdrop-filter: blur(10px); min-width: 300px; }
.hero-btc .row { display: flex; align-items: center; gap: 10px; color: var(--mist); font-size: .92rem; }
.hero-btc .row img { width: 26px; height: 26px; }
.hero-btc .big { display: block; margin: 8px 0 2px; font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 4vw, 2.7rem); line-height: 1.1; text-align: right; }
.hero-btc .chg { font-size: 1rem; }
.hero-btc .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .86rem; }
.hero-btc .stats span { display: block; color: var(--mist); font-size: .78rem; }
.waves { position: absolute; inset: auto 0 0 0; height: 300px; z-index: 1; pointer-events: none; }
.waves svg { position: absolute; bottom: 0; left: 0; width: 200%; height: 100%; }
.wave-back, .wave-mid { left: -100% !important; }
.wave-back { fill: rgba(43, 184, 217, .10); animation: drift 26s linear infinite; }
.wave-mid { fill: rgba(55, 226, 201, .09); animation: drift 18s linear infinite reverse; }
.wave-data { width: 100% !important; animation: bob 7s ease-in-out infinite; }
.wave-data .area { fill: url(#gHero); }
.wave-data .crest { fill: none; stroke: var(--glow); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 10px rgba(55, 226, 201, .55)); stroke-dasharray: 4000; stroke-dashoffset: 4000; animation: draw 2.4s cubic-bezier(.3, .7, .2, 1) .2s forwards; }
.wave-data .head { fill: var(--foam); stroke: var(--glow); stroke-width: 3; }
.wave-label { position: absolute; z-index: 2; font-size: .78rem; color: var(--mist); bottom: 54px; left: 50%; transform: translateX(-50%); white-space: nowrap; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(50%); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* أزرار */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(232, 245, 243, .04); font-weight: 500; font-size: .98rem; transition: background .2s, border-color .2s, transform .15s; }
.btn:hover { border-color: var(--glow); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--glow); color: var(--abyss); border-color: var(--glow); }
.btn-primary:hover { background: #5cf0da; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .88rem; }
.btn-block { width: 100%; }
.btn-danger { border-color: rgba(255, 107, 138, .5); color: var(--down); }

/* ---------- الإحصاءات العامة ---------- */
.global-strip { position: relative; z-index: 4; display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: var(--r-lg); background: rgba(5, 21, 38, .7); backdrop-filter: blur(10px); margin-top: -40px; }
.global-strip > div { padding: 16px 20px; border-inline-start: 1px solid var(--line); }
.global-strip > div:first-child { border-inline-start: 0; }
.global-strip span { display: block; color: var(--mist); font-size: .82rem; }
.global-strip strong { display: block; font-size: 1.18rem; font-weight: 500; margin-top: 2px; text-align: right; }
.global-strip small { font-size: .8rem; }

/* ---------- الجداول ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.mtable { width: 100%; border-collapse: collapse; font-size: .94rem; }
.mtable th { text-align: start; font-weight: 400; color: var(--mist); font-size: .82rem; padding: 14px 14px; border-bottom: 1px solid var(--line); background: rgba(5, 21, 38, .35); white-space: nowrap; cursor: default; }
.mtable th[data-sort] { cursor: pointer; user-select: none; }
.mtable th[data-sort]:hover { color: var(--foam); }
.mtable th.sorted::after { content: " ↓"; color: var(--glow); }
.mtable th.sorted.asc::after { content: " ↑"; }
.mtable td { padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mtable tbody tr { transition: background .15s; cursor: pointer; }
.mtable tbody tr:hover { background: rgba(55, 226, 201, .05); }
.mtable tbody tr:last-child td { border-bottom: 0; }
.mtable td.n, .mtable th.n { text-align: left; }
.coin-cell { display: flex; align-items: center; gap: 11px; }
.coin-cell img { width: 28px; height: 28px; border-radius: 50%; background: var(--tide); }
.coin-cell b { font-weight: 500; display: block; line-height: 1.2; }
.coin-cell small { color: var(--mist); font-size: .78rem; text-transform: uppercase; }
.rank { color: var(--mist-2); font-size: .82rem; width: 36px; }
.spark { width: 120px; height: 36px; display: block; }
.spark path.l { fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.flash-up { animation: fu .9s; }
.flash-down { animation: fd .9s; }
@keyframes fu { 0% { background: rgba(59, 232, 168, .22); } 100% { background: transparent; } }
@keyframes fd { 0% { background: rgba(255, 107, 138, .22); } 100% { background: transparent; } }
.price.flash-up, .big.flash-up { color: var(--up); background: none; animation: none; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 20px 0 14px; }
.input, .form input, .form select, .form textarea, .toolbar input, .toolbar select {
  height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: rgba(5, 21, 38, .6); color: var(--foam); font: inherit; font-size: .95rem; min-width: 0;
}
.form textarea { height: auto; padding: 12px 14px; line-height: 1.7; resize: vertical; }
.input:focus, .form input:focus, .form select:focus, .form textarea:focus, .toolbar input:focus { outline: none; border-color: var(--glow); box-shadow: 0 0 0 3px rgba(55, 226, 201, .15); }
.toolbar .grow { flex: 1; min-width: 200px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--mist); font-size: .88rem; }
.chip.is-on { background: var(--foam); color: var(--abyss); border-color: var(--foam); }

/* ---------- الشبكات ---------- */
.grid { display: grid; gap: 18px; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.g-4 { grid-template-columns: repeat(4, 1fr); }

/* بطاقات الأصول (أسهم/معادن) */
.asset { position: relative; padding: 18px 18px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel); overflow: hidden; cursor: pointer; transition: border-color .2s; }
.asset:hover { border-color: var(--line-2); }
.asset-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.asset-sym { font-weight: 600; font-size: 1rem; direction: ltr; }
.asset-name { color: var(--mist); font-size: .8rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 18ch; }
.asset-price { font-size: 1.45rem; font-weight: 500; margin-top: 10px; text-align: right; }
.asset-chg { font-size: .88rem; text-align: right; }
.asset .spark { width: 100%; height: 46px; margin-top: 8px; }
.asset .tag { font-size: .72rem; color: var(--mist); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }

/* المعادن — الذهب هو البطل */
.gold-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 0; border-radius: var(--r-lg); border: 1px solid rgba(255, 193, 94, .28); background: linear-gradient(135deg, rgba(255, 193, 94, .10), rgba(17, 56, 90, .3) 60%); overflow: hidden; margin-top: 24px; }
.gold-hero .main { padding: 28px; }
.gold-hero .main .label { color: var(--sun); font-size: .92rem; }
.gold-hero .main .big { font-family: var(--display); font-weight: 700; font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.1; margin: 8px 0; text-align: right; }
.karats { padding: 22px 26px; border-inline-start: 1px solid rgba(255, 193, 94, .2); background: rgba(5, 21, 38, .35); }
.karats table { width: 100%; border-collapse: collapse; }
.karats td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.karats tr:last-child td { border-bottom: 0; }
.karats td:last-child { text-align: left; font-weight: 500; }
.karats .k { color: var(--sun); font-weight: 500; }

/* ---------- الحاسبة ---------- */
.conv { max-width: 760px; margin: 28px auto 0; padding: 30px; border-radius: 28px; border: 1px solid var(--line-2); background: linear-gradient(160deg, rgba(17, 56, 90, .6), rgba(5, 21, 38, .6)); position: relative; overflow: hidden; }
.conv::after { content: ""; position: absolute; inset: auto -10% -60px -10%; height: 140px; background: radial-gradient(60% 100% at 50% 100%, rgba(55, 226, 201, .18), transparent); pointer-events: none; }
.conv-row { display: grid; grid-template-columns: 1fr 230px; gap: 0; border: 1px solid var(--line-2); border-radius: 18px; background: rgba(5, 21, 38, .55); overflow: hidden; }
.conv-row input { border: 0; background: transparent; color: var(--foam); font: inherit; font-size: 1.7rem; padding: 18px 20px; direction: ltr; text-align: right; min-width: 0; font-variant-numeric: tabular-nums; }
.conv-row input:focus { outline: none; }
.conv-row:focus-within { border-color: var(--glow); }
.conv-pick { border-inline-start: 1px solid var(--line-2); position: relative; }
.conv-pick button { width: 100%; height: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 10px; padding: 0 16px; text-align: start; }
.conv-pick img, .conv-pick .flag { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--tide); font-size: .78rem; font-weight: 600; }
.conv-pick b { display: block; font-weight: 500; line-height: 1.2; }
.conv-pick small { color: var(--mist); font-size: .76rem; }
.conv-swap { display: grid; place-items: center; margin: -8px 0; position: relative; z-index: 2; }
.conv-swap button { width: 50px; height: 50px; border-radius: 50%; border: 4px solid #0a2540; background: var(--glow); color: var(--abyss); display: grid; place-items: center; transition: transform .35s; }
.conv-swap button.spin { transform: rotate(180deg); }
.conv-swap svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.conv-rate { text-align: center; margin-top: 20px; color: var(--mist); font-size: .95rem; }
.conv-quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; position: relative; z-index: 1; }
.picker { position: fixed; inset: 0; z-index: 90; background: rgba(2, 10, 18, .7); display: grid; place-items: center; padding: 16px; }
.picker-box { width: min(520px, 100%); max-height: 80vh; display: flex; flex-direction: column; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 20px; overflow: hidden; }
.picker-box input { margin: 14px; }
.picker-tabs { display: flex; gap: 6px; padding: 0 14px 10px; }
.picker-list { overflow-y: auto; list-style: none; margin: 0; padding: 0 6px 10px; }
.picker-list li button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 10px; border: 0; background: transparent; border-radius: 10px; text-align: start; }
.picker-list li button:hover { background: rgba(55, 226, 201, .08); }
.picker-list img, .picker-list .flag { width: 28px; height: 28px; border-radius: 50%; background: var(--tide); display: grid; place-items: center; font-size: .72rem; font-weight: 600; flex: none; }
.picker-list small { color: var(--mist); margin-inline-start: auto; font-size: .78rem; }

/* ---------- المؤشرات ---------- */
.gauge-wrap { text-align: center; }
.gauge { width: 100%; max-width: 320px; margin: 0 auto; display: block; }
.gauge-val { font-family: var(--display); font-weight: 800; font-size: 3rem; line-height: 1; margin-top: -54px; }
.gauge-txt { font-size: 1.05rem; margin-top: 6px; }
.fng-hist { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; font-size: .84rem; }
.fng-hist div { padding: 10px; border-radius: 12px; background: rgba(5, 21, 38, .5); border: 1px solid var(--line); }
.fng-hist span { display: block; color: var(--mist); font-size: .76rem; }
.bar { height: 10px; border-radius: 999px; background: rgba(143, 179, 196, .15); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.legend-row { display: flex; justify-content: space-between; font-size: .84rem; margin-top: 8px; color: var(--mist); }
.rsi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.rsi-cell { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(5, 21, 38, .45); }
.rsi-cell b { font-weight: 500; }
.rsi-cell .v { font-size: 1.3rem; font-weight: 500; display: block; margin-top: 2px; }
.rsi-cell .s { font-size: .76rem; color: var(--mist); }
.rsi-cell.hot { border-color: rgba(255, 107, 138, .45); }
.rsi-cell.cold { border-color: rgba(59, 232, 168, .45); }
.movers li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.movers li:last-child { border-bottom: 0; }
.movers { list-style: none; margin: 0; padding: 0; }
.movers img { width: 24px; height: 24px; border-radius: 50%; }
.movers .p { margin-inline-start: auto; text-align: left; }
.season-bar { position: relative; height: 14px; border-radius: 999px; background: linear-gradient(270deg, var(--sun), #6f8fa3 50%, var(--glow)); }
.season-bar i { position: absolute; top: -6px; width: 4px; height: 26px; border-radius: 4px; background: var(--foam); box-shadow: 0 0 0 3px rgba(5, 21, 38, .8); transition: left 1s; }

/* ---------- صفحة العملة ---------- */
.coin-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin: 34px 0 20px; }
.coin-head img { width: 56px; height: 56px; }
.coin-head h1 { margin: 0; font-family: var(--display); font-size: 2rem; line-height: 1.2; }
.coin-head .big { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 4vw, 2.6rem); }
.chart-box { height: 430px; position: relative; }
.chart-box.sm { height: 300px; }
.chart-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 0; }
.kv > div { display: contents; }
.kv span, .kv strong { padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.kv span { color: var(--mist); }
.kv strong { font-weight: 500; text-align: left; }
.supply-bar { margin-top: 14px; }
.coin-desc { color: var(--mist); font-size: .93rem; line-height: 1.85; direction: ltr; text-align: left; }

/* ---------- المقالات ---------- */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.post { display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--panel); transition: border-color .2s; }
.post:hover { border-color: var(--line-2); }
.post-cover { aspect-ratio: 16/9; background: linear-gradient(135deg, #0f4a6e, #062037); position: relative; overflow: hidden; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-cover svg { position: absolute; inset: auto 0 0 0; width: 100%; height: 60%; }
.post-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-cat { color: var(--glow); font-size: .84rem; }
.post h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.15rem; line-height: 1.5; }
.post p { margin: 0; color: var(--mist); font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { margin-top: auto; padding-top: 8px; color: var(--mist-2); font-size: .82rem; }
.post.featured { grid-column: span 2; flex-direction: row; }
.post.featured .post-cover { aspect-ratio: auto; flex: 1.2; min-height: 280px; }
.post.featured .post-body { flex: 1; padding: 28px; justify-content: center; }
.post.featured h3 { font-size: 1.55rem; line-height: 1.4; }

.article { max-width: 760px; margin: 0 auto; }
.article-head { margin: 46px 0 26px; }
.article-head h1 { font-family: var(--display); font-weight: 800; font-size: clamp(1.9rem, 4.6vw, 2.8rem); line-height: 1.3; margin: 10px 0 14px; }
.article-cover { border-radius: var(--r-lg); overflow: hidden; margin-bottom: 30px; border: 1px solid var(--line); }
.prose { font-size: 1.1rem; line-height: 2; color: #d5e7e6; }
.prose h2 { font-family: var(--display); font-size: 1.55rem; line-height: 1.45; margin: 2.1em 0 .6em; color: var(--foam); }
.prose h3 { font-family: var(--display); font-size: 1.25rem; margin: 1.8em 0 .5em; color: var(--foam); }
.prose p { margin: 0 0 1.2em; }
.prose a { color: var(--glow); text-decoration: underline; text-underline-offset: 4px; }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin: 0 0 1.3em; }
.prose li { margin-bottom: .45em; }
.prose blockquote { margin: 1.6em 0; padding: 4px 22px; border-inline-start: 3px solid var(--glow); color: var(--foam); font-size: 1.15rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .96rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line-2); padding: 9px 12px; text-align: start; }
.prose th { background: rgba(17, 56, 90, .5); font-weight: 500; }
.prose img { border-radius: var(--r-md); margin: 1.4em 0; }
.prose hr { border: 0; border-top: 1px solid var(--line-2); margin: 2.4em 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.tags span { font-size: .84rem; padding: 4px 12px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--mist); }
.share { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.disclaimer { margin-top: 34px; padding: 16px 18px; border-radius: var(--r-md); background: rgba(255, 193, 94, .08); border: 1px solid rgba(255, 193, 94, .22); font-size: .9rem; color: #f3dcae; }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 34px; }

/* ---------- عام ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--mist); }
.skeleton { background: linear-gradient(90deg, rgba(143, 179, 196, .08), rgba(143, 179, 196, .16), rgba(143, 179, 196, .08)); background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: 8px; color: transparent !important; }
@keyframes sk { to { background-position: -200% 0; } }
.alert { padding: 12px 16px; border-radius: 12px; font-size: .95rem; }
.alert-ok { background: rgba(59, 232, 168, .1); border: 1px solid rgba(59, 232, 168, .35); color: #bff7e1; }
.alert-err { background: rgba(255, 107, 138, .1); border: 1px solid rgba(255, 107, 138, .35); color: #ffd0da; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; }

/* البحث */
.search-layer { position: fixed; inset: 0; z-index: 100; background: rgba(2, 10, 18, .72); backdrop-filter: blur(6px); display: flex; justify-content: center; padding: 80px 16px 16px; }
.search-layer[hidden] { display: none; }
.search-panel { width: min(600px, 100%); max-height: 70vh; display: flex; flex-direction: column; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 20px; overflow: hidden; }
.search-panel input { height: 58px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--foam); font: inherit; font-size: 1.08rem; padding: 0 20px; }
.search-panel input:focus { outline: none; }
.search-results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.search-results a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; }
.search-results a:hover, .search-results a.is-focus { background: rgba(55, 226, 201, .08); }
.search-results img { width: 26px; height: 26px; border-radius: 50%; }
.search-results .p { margin-inline-start: auto; text-align: left; font-size: .9rem; }
.search-close { border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--mist); height: 46px; }

/* الفوتر */
.site-footer { position: relative; margin-top: 70px; background: #031020; }
.footer-wave { position: absolute; top: -60px; left: 0; width: 100%; height: 62px; fill: #031020; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 30px var(--gutter) 40px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px 40px; }
.footer-brand { font-family: var(--display); font-size: 1.4rem; }
.footer-inner p { margin: 6px 0 0; color: var(--mist); font-size: .92rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; align-content: start; color: var(--mist); font-size: .93rem; }
.footer-links a:hover { color: var(--foam); }
.footer-note { grid-column: 1 / -1; font-size: .82rem !important; color: var(--mist-2) !important; border-top: 1px solid var(--line); padding-top: 18px; }

/* تنقل الهاتف */
.bottombar, .more-sheet { display: none; }

/* ---------- التثبيت ---------- */
.install-page { display: grid; place-items: center; padding: 30px 16px; }
.install-card { width: min(640px, 100%); padding: 30px; border-radius: 24px; border: 1px solid var(--line-2); background: rgba(10, 37, 64, .7); }
.install-title { font-family: var(--display); margin: 0 0 18px; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form fieldset { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px 18px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.form legend { padding: 0 8px; color: var(--glow); font-weight: 500; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--mist); }
.form label.radio { flex-direction: row; align-items: center; gap: 10px; color: var(--foam); }
.form label.radio input { height: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span-2 { grid-column: span 2; }

/* ==========================================================
   الهاتف
   ========================================================== */
@media (max-width: 1080px) {
  .mainnav { display: none; }
  .g-main { grid-template-columns: 1fr; }
  .posts { grid-template-columns: repeat(2, 1fr); }
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .global-strip { grid-template-columns: repeat(3, 1fr); }
  .global-strip > div:nth-child(4) { border-inline-start: 0; }
  .global-strip > div:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  body { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); font-size: 15px; }
  .topbar-inner { height: 56px; }
  .brand { font-size: 1.3rem; }
  .hero { min-height: 0; padding-top: 30px; padding-bottom: 210px; }
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .hero h1 { font-size: 2.35rem; }
  .hero-sub { font-size: 1rem; margin: 12px 0 20px; }
  .hero-btc { justify-self: stretch; min-width: 0; }
  .waves { height: 220px; }
  .global-strip { grid-template-columns: 1fr 1fr; margin-top: -30px; }
  .global-strip > div { padding: 12px 14px; border-inline-start: 0; border-top: 1px solid var(--line); }
  .global-strip > div:nth-child(-n+2) { border-top: 0; }
  .global-strip > div:nth-child(even) { border-inline-start: 1px solid var(--line); }
  .global-strip > div:last-child { grid-column: span 2; border-inline-start: 0; }
  .g-3, .g-2, .posts { grid-template-columns: 1fr; }
  .g-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .post.featured { grid-column: auto; flex-direction: column; }
  .post.featured .post-cover { min-height: 0; aspect-ratio: 16/9; flex: none; }
  .post.featured .post-body { padding: 18px 20px; }
  .post.featured h3 { font-size: 1.25rem; }
  .section { margin-top: 40px; }

  /* الجدول يتحول لقائمة بطاقات */
  .mtable thead { display: none; }
  .mtable .hide-m { display: none; }
  .mtable tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "coin price" "coin chg"; padding: 12px 14px; border-bottom: 1px solid var(--line); gap: 0 10px; }
  .mtable td { padding: 0; border: 0; }
  .mtable td.c-coin { grid-area: coin; align-self: center; }
  .mtable td.c-price { grid-area: price; text-align: left; font-weight: 500; }
  .mtable td.c-chg { grid-area: chg; text-align: left; font-size: .85rem; }
  .mtable td.rank { display: none; }
  .asset { padding: 14px; }
  .asset-price { font-size: 1.15rem; }
  .gold-hero { grid-template-columns: 1fr; }
  .karats { border-inline-start: 0; border-top: 1px solid rgba(255, 193, 94, .2); }
  .conv { padding: 18px; border-radius: 22px; }
  .conv-row { grid-template-columns: 1fr; }
  .conv-pick { border-inline-start: 0; border-top: 1px solid var(--line-2); height: 58px; }
  .conv-row input { font-size: 1.5rem; padding: 14px 16px; }
  .chart-box { height: 320px; }
  .footer-inner { grid-template-columns: 1fr; padding-bottom: 20px; }
  .footer-links { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .live-dot b { display: none; }

  .bottombar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; inset: auto 0 0 0; z-index: 60;
    height: calc(var(--bar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(5, 21, 38, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .bottombar a, .bottombar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .7rem; color: var(--mist); border: 0; background: transparent; position: relative; }
  .bottombar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bottombar .is-active { color: var(--glow); }
  .bottombar .is-active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--glow); }
  .more-sheet { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(2, 10, 18, .6); }
  .more-sheet[hidden] { display: none; }
  .more-panel { position: absolute; inset: auto 0 0 0; padding: 14px 14px calc(var(--bar-h) + 14px + env(safe-area-inset-bottom)); background: var(--panel-solid); border-radius: 22px 22px 0 0; border-top: 1px solid var(--line-2); display: grid; gap: 4px; animation: up .25s ease-out; }
  .more-panel a, .more-panel button { display: flex; align-items: center; gap: 14px; padding: 14px 12px; border-radius: 12px; border: 0; background: transparent; font-size: 1rem; text-align: start; }
  .more-panel a:active, .more-panel button:active { background: rgba(55, 226, 201, .08); }
  @keyframes up { from { transform: translateY(100%); } }
  .search-layer { padding-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .wave-data .crest { stroke-dashoffset: 0; }
}
.picker[hidden] { display: none; }
.up, .down, [data-mode="pct"], .tick-item span { direction: ltr; unicode-bidi: isolate; }
.conv-rate span { display: block; }
.toc { margin: 0 0 30px; padding: 18px 22px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: rgba(17, 56, 90, .3); }
.toc strong { font-family: var(--display); font-weight: 700; }
.toc ol { margin: 10px 0 0; padding-inline-start: 1.3em; color: var(--mist); }
.toc li { margin: 4px 0; }
.toc a:hover { color: var(--glow); }
.prose h2[id] { scroll-margin-top: 110px; }
.seo-summary { max-width: 72ch; color: var(--mist); font-size: 1rem; line-height: 1.9; margin: 0 0 6px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--glow); font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 10px 0 0; color: var(--mist); }

/* ---------- قائمة اللغات ---------- */
.lang-menu { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-size: .84rem; }
.lang-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.lang-list { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 80; list-style: none; margin: 0; padding: 6px; min-width: 180px; max-height: 60vh; overflow: auto; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.lang-list[hidden] { display: none; }
.lang-list a { display: block; padding: 9px 12px; border-radius: 9px; font-size: .92rem; }
.lang-list a:hover { background: rgba(55, 226, 201, .08); }
.lang-list a.is-on { color: var(--glow); }
.more-langs { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 4px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.more-langs .chip { display: inline-flex; align-items: center; }
@media (max-width: 760px) { .lang-menu { display: none; } }

/* ---------- اللغات من اليسار لليمين ---------- */
[dir="ltr"] .ticker-track { animation-name: tick-ltr; }
@keyframes tick-ltr { from { transform: translateX(0); } to { transform: translateX(-50%); } }
[dir="ltr"] .hero-btc .big, [dir="ltr"] .global-strip strong, [dir="ltr"] .asset-price, [dir="ltr"] .asset-chg,
[dir="ltr"] .gold-hero .main .big, [dir="ltr"] #qOut, [dir="ltr"] #qLocal { text-align: left; }
[dir="ltr"] .mtable td.n, [dir="ltr"] .mtable th.n, [dir="ltr"] .kv strong, [dir="ltr"] .karats td:last-child, [dir="ltr"] .movers .p, [dir="ltr"] .search-results .p { text-align: right; }
[dir="ltr"] .season-bar { background: linear-gradient(90deg, var(--sun), #6f8fa3 50%, var(--glow)); }
[dir="ltr"] .legend-row.rev { flex-direction: row-reverse; }
[dir="ltr"] .coin-desc { text-align: left; }
[dir="ltr"] .conv-row input { text-align: left; }
@media (max-width: 760px) {
  [dir="ltr"] .mtable td.c-price, [dir="ltr"] .mtable td.c-chg { text-align: right; }
}
.chart-fig { margin: 1.8em 0; }
.prose .chart-fig img { width: 100%; height: auto; margin: 0; border-radius: var(--r-md); border: 1px solid var(--line); }
.chart-fig figcaption { margin-top: 8px; font-size: .86rem; line-height: 1.7; color: var(--mist); }
.load-more { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.search-all { margin-top: 16px; }
.search-all[hidden] { display: none; }
