/* =========================================================================
   Gold Index — design system
   ========================================================================= */

:root {
  --bg: #F5F4F0;
  --surface: #FFFFFF;
  --surface-2: #FAF9F6;
  --ink: #0E1216;
  --ink-2: #353B43;
  --muted: #5F656E;
  --faint: #676D75;
  --line: #E5E2DA;
  --line-2: #EFEDE7;

  --gold: #765811;
  --gold-2: #B8933A;
  --gold-bg: #F4EEDF;

  --up: #057A48;
  --up-bg: #E5F4EC;
  --down: #B42318;
  --down-bg: #FCEBE9;
  --flat-bg: #EFEEEA;

  --top: #0D1115;
  --top-ink: #BFC5CC;
  --top-strong: #F2F4F6;
  --top-line: #1E242B;

  --r: 14px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(14, 18, 22, .04), 0 0 0 1px rgba(14, 18, 22, .02);
  --wrap: 1240px;
  --gutter: 24px;
  --font: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0A0D10;
  --surface: #11151A;
  --surface-2: #14191F;
  --ink: #ECEEF0;
  --ink-2: #C3C8CE;
  --muted: #8A919A;
  --faint: #858C95;
  --line: #222830;
  --line-2: #1A1F25;
  --gold: #D4B062;
  --gold-2: #E6C887;
  --gold-bg: #262013;
  --up: #3DC581;
  --up-bg: #0E2619;
  --down: #F06A5D;
  --down-bg: #2C1412;
  --flat-bg: #1C2127;
  --top: #06080A;
  --top-line: #171C21;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .02);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0D10;
    --surface: #11151A;
    --surface-2: #14191F;
    --ink: #ECEEF0;
    --ink-2: #C3C8CE;
    --muted: #8A919A;
    --faint: #858C95;
    --line: #222830;
    --line-2: #1A1F25;
    --gold: #D4B062;
    --gold-2: #E6C887;
    --gold-bg: #262013;
    --up: #3DC581;
    --up-bg: #0E2619;
    --down: #F06A5D;
    --down-bg: #2C1412;
    --flat-bg: #1C2127;
    --top: #06080A;
    --top-line: #171C21;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .02);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold); }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 600; letter-spacing: -.005em; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 4px; }

.num { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "lnum" 1; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Ticker ---------- */
.ticker { background: var(--top); color: var(--top-ink); font-size: 12.5px; border-bottom: 1px solid var(--top-line); }
.ticker .wrap { display: flex; align-items: center; gap: 0; height: 36px; overflow-x: auto; scrollbar-width: none; }
.ticker .wrap::-webkit-scrollbar { display: none; }
.tick { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 0 16px; border-inline-start: 1px solid var(--top-line); height: 100%; }
.tick:first-child { border-inline-start: 0; padding-inline-start: 0; }
.tick b { color: var(--top-strong); font-weight: 500; }
.tick .chg.up { color: #45C98A; }
.tick .chg.down { color: #F27B6F; }
.tick .chg.flat { color: var(--top-ink); }
.tick-status { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; padding-inline-start: 16px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #45C98A; box-shadow: 0 0 0 3px rgba(69, 201, 138, .15); }

/* ---------- Header ---------- */
.header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.header .wrap { display: flex; align-items: center; gap: 32px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: -2px; }
.nav { display: flex; align-items: center; gap: 4px; height: 100%; }
.nav a { position: relative; display: inline-flex; align-items: center; height: 100%; padding: 0 12px; color: var(--ink-2); font-weight: 500; font-size: 14.5px; }
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); }
.nav a.active::after { content: ""; position: absolute; inset-inline: 12px; bottom: -1px; height: 2px; background: var(--gold); border-radius: 2px; }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { border-color: var(--faint); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }
.theme-sun { display: none; }
[data-theme="dark"] .theme-sun { display: block; }
[data-theme="dark"] .theme-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-sun { display: block; }
  :root:not([data-theme="light"]) .theme-moon { display: none; }
}

/* country tabs */
.markets { background: var(--surface); border-bottom: 1px solid var(--line); }
.markets .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; height: 46px; align-items: stretch; }
.markets .wrap::-webkit-scrollbar { display: none; }
.markets a { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; white-space: nowrap; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; }
.markets a:hover { color: var(--ink); }
.markets a.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.cc { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; line-height: 16px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; text-transform: uppercase; }

/* ---------- Layout ---------- */
main { padding: 28px 0 56px; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.stack { display: grid; gap: 24px; min-width: 0; }
.side { display: grid; gap: 24px; position: sticky; top: 88px; }

.page-head { margin-bottom: 22px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs span[aria-hidden] { color: var(--faint); }
.page-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -.015em; }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 8px; color: var(--muted); font-size: 13.5px; }
.page-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.lede { color: var(--ink-2); font-size: 16px; max-width: 760px; margin-top: 10px; }

/* ---------- Card ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px 0; flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 16.5px; font-weight: 600; }
.card-head .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 18px 22px 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.link { color: var(--gold); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { color: var(--ink); }
.link svg { width: 14px; height: 14px; }

/* ---------- Quote hero ---------- */
.quote { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.quote-main { padding: 26px 26px 24px; border-inline-end: 1px solid var(--line-2); }
.quote-label { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.quote-label .tag { background: var(--gold-bg); color: var(--gold); font-weight: 600; font-size: 12px; border-radius: 6px; padding: 1px 8px; }
.quote-price { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 12px; flex-wrap: wrap; }
.quote-price .num { font-size: 52px; line-height: 1.05; font-weight: 600; letter-spacing: -.025em; }
.quote-price .cur { font-size: 16px; color: var(--muted); font-weight: 500; }
.quote-change { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.quote-side { display: grid; grid-template-columns: 1fr 1fr; }
.kv { padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.kv:nth-child(odd) { border-inline-end: 1px solid var(--line-2); }
.kv:nth-last-child(-n+2) { border-bottom: 0; }
.kv dt { font-size: 12.5px; color: var(--muted); }
.kv dd { margin: 4px 0 0; font-size: 18px; font-weight: 600; }
.kv dd small { font-size: 12px; color: var(--muted); font-weight: 400; margin-inline-start: 4px; }

.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px 2px 9px; font-size: 13px; font-weight: 600; line-height: 1.6; }
.pill svg { width: 12px; height: 12px; }
.pill.up { color: var(--up); background: var(--up-bg); }
.pill.down { color: var(--down); background: var(--down-bg); }
.pill.flat { color: var(--muted); background: var(--flat-bg); }
.chg.up { color: var(--up); }
.chg.down { color: var(--down); }
.chg.flat { color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: start; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 10px 22px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 14px 22px; border-bottom: 1px solid var(--line-2); white-space: nowrap; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .strong { font-weight: 600; font-size: 15.5px; }
.table .end { text-align: end; }
.table td a.row-link { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.table .spark { width: 96px; height: 28px; }
.karat-badge { display: inline-grid; place-items: center; min-width: 34px; height: 24px; border-radius: 6px; background: var(--gold-bg); color: var(--gold); font-weight: 700; font-size: 12.5px; padding: 0 6px; }

/* ---------- Chart ---------- */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 4px 12px; font-size: 13px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); }
.chart-box { position: relative; height: 300px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 14px; padding: 20px; }
.chart-empty[hidden] { display: none; }
.chart-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.select { appearance: none; border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2369707A' stroke-width='1.6' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E") no-repeat left 10px center; border-radius: 10px; padding: 6px 12px 6px 30px; font-size: 13.5px; cursor: pointer; }

/* ---------- Performance strip ---------- */
.perf { display: grid; grid-template-columns: repeat(4, 1fr); }
.perf div { padding: 16px 22px; border-inline-start: 1px solid var(--line-2); }
.perf div:first-child { border-inline-start: 0; }
.perf dt { font-size: 12.5px; color: var(--muted); }
.perf dd { margin: 3px 0 0; font-size: 17px; font-weight: 600; }

/* ---------- Report ---------- */
.report-card { display: grid; gap: 10px; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--gold); letter-spacing: .02em; display: inline-flex; align-items: center; gap: 8px; }
.report-card h3 { font-size: 20px; font-weight: 600; line-height: 1.45; }
.report-card p { color: var(--ink-2); margin: 0; }
.report-list { display: grid; }
.report-list a { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line-2); font-size: 14.5px; }
.report-list a:first-child { border-top: 0; }
.report-list time { color: var(--muted); font-size: 13px; }

.article { font-size: 17px; line-height: 1.95; color: var(--ink-2); }
.article p { margin: 0 0 1.15em; }
.article p:first-child { color: var(--ink); font-size: 18px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13px; padding-top: 14px; border-top: 1px solid var(--line-2); }

/* ---------- Mini lists / side ---------- */
.mini-list { display: grid; }
.mini-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--line-2); font-size: 14px; }
.mini-list a:first-child { border-top: 0; }
.mini-list a:hover { background: var(--surface-2); color: var(--ink); }
.mini-list .name { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; }
.mini-list .val { text-align: end; line-height: 1.35; }
.mini-list .val small { display: block; font-size: 12px; }

/* ---------- Forms / calculators ---------- */
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; }
.field label, .field .label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  padding: 10px 12px; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.field select { appearance: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2369707A' stroke-width='1.6' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E") no-repeat left 12px center; padding-left: 32px; }
.input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold-2); box-shadow: 0 0 0 3px var(--gold-bg); }
.input.num { text-align: right; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 10px 18px; font-weight: 600; font-size: 14.5px; border: 1px solid var(--ink); background: var(--ink); color: var(--surface); cursor: pointer; }
.btn:hover { opacity: .9; color: var(--surface); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--faint); color: var(--ink); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.result { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: grid; gap: 10px; }
.result-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.result-row.total { border-top: 1px solid var(--line); padding-top: 12px; font-size: 17px; font-weight: 700; }
.result-big { font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.note { font-size: 13px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; }

.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tool { display: grid; gap: 6px; padding: 20px 22px; }
.tool:hover { border-color: var(--faint); color: var(--ink); }
.tool .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-bg); color: var(--gold); margin-bottom: 6px; }
.tool .ico svg { width: 18px; height: 18px; }
.tool h2 { font-size: 15.5px; }
.tool p { font-size: 13.5px; color: var(--muted); margin: 0; }

/* ---------- FAQ ---------- */
.faq details { border-top: 1px solid var(--line-2); }
.faq details:first-of-type { border-top: 0; }
.faq summary { list-style: none; cursor: pointer; padding: 16px 22px; font-weight: 500; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 9px; height: 9px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg); transition: transform .2s; flex: none; margin-top: -4px; }
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.faq .answer { padding: 0 22px 18px; color: var(--ink-2); font-size: 14.5px; }

/* ---------- Ads ---------- */
.ad { display: grid; gap: 4px; justify-items: center; min-width: 0; overflow: hidden; }
.ad-label { font-size: 10.5px; color: var(--faint); letter-spacing: .06em; }
.ad ins { width: 100%; }
.ad-header { margin: 18px 0 0; min-height: 110px; }
.ad-content { min-height: 120px; }
.ad-sidebar { min-height: 270px; }
.ad-article { margin: 6px 0 24px; min-height: 120px; }
.ad-footer { margin-bottom: 28px; min-height: 110px; }
.ad-placeholder { width: 100%; height: 100%; min-height: inherit; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 10px; color: var(--faint); font-size: 12px; background: repeating-linear-gradient(-45deg, transparent 0 10px, var(--line-2) 10px 11px); }

/* ---------- Pagination ---------- */
.pager { display: flex; justify-content: center; gap: 6px; padding: 18px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); font-size: 13.5px; padding: 0 10px; background: var(--surface); }
.pager .current { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.pager .disabled { color: var(--faint); }

.day-nav { display: flex; justify-content: space-between; gap: 12px; }
.day-nav a { display: grid; padding: 14px 18px; flex: 1; }
.day-nav a small { color: var(--muted); font-size: 12px; }
.day-nav a:last-child { text-align: end; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 14px; font-size: 13.5px; color: var(--ink-2); }
.chip.active, .chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); color: var(--surface); }

.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.report-tile { display: grid; gap: 8px; padding: 20px 22px; align-content: start; }
.report-tile h2 { font-size: 16px; line-height: 1.5; }
.report-tile p { font-size: 14px; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.report-tile:hover { border-color: var(--faint); color: var(--ink); }

.prose { font-size: 16px; line-height: 1.9; color: var(--ink-2); max-width: 820px; }
.prose h2 { font-size: 20px; color: var(--ink); margin: 28px 0 10px; }
.prose ul { padding-inline-start: 20px; }
.prose li { margin-bottom: 6px; }

.empty-state { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-state h2 { color: var(--ink); font-size: 18px; margin-bottom: 6px; }

/* ---------- Footer ---------- */
.footer { background: var(--surface); border-top: 1px solid var(--line); padding: 44px 0 26px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.footer h2 { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer ul a { color: var(--ink-2); }
.footer ul a:hover { color: var(--ink); }
.footer-about p { color: var(--muted); margin-top: 12px; max-width: 340px; }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
.footer-bottom p { margin: 0; max-width: 760px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .mobile-nav { display: flex !important; }
  .quote { grid-template-columns: 1fr; }
  .quote-main { border-inline-end: 0; border-bottom: 1px solid var(--line-2); }
  .tool-grid, .cards-3 { grid-template-columns: 1fr; }
  .perf { grid-template-columns: 1fr 1fr; }
  .perf div:nth-child(3) { border-inline-start: 0; }
  .perf div:nth-child(n+3) { border-top: 1px solid var(--line-2); }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  body { font-size: 14.5px; }
  main { padding-top: 20px; }
  .page-head h1 { font-size: 23px; }
  .quote-main { padding: 20px; }
  .quote-price .num { font-size: 40px; }
  .kv { padding: 14px 16px; }
  .kv dd { font-size: 16px; }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 16px; }
  .card-foot { padding: 12px 16px; }
  .table th, .table td { padding: 12px 14px; }
  .table .hide-sm { display: none; }
  .mini-list a { padding: 12px 16px; }
  .faq summary { padding: 14px 16px; }
  .faq .answer { padding: 0 16px 16px; }
  .chart-box { height: 240px; }
  .footer-grid { grid-template-columns: 1fr; }
  .brand small { display: none; }
  .article { font-size: 16px; }
}
.mobile-nav { display: none; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 0 var(--gutter) 10px; background: var(--surface); }
.mobile-nav::-webkit-scrollbar { display: none; }
.mobile-nav a { white-space: nowrap; font-size: 13.5px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.mobile-nav a.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }

@media print {
  .ticker, .header, .markets, .ad, .footer, .side { display: none !important; }
  .grid { grid-template-columns: 1fr; }
}

/* ---------- Language switch ---------- */
.lang-switch { display: flex; gap: 4px; }
.lang-switch a { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.lang-switch a:hover { border-color: var(--faint); color: var(--ink); }

/* ---------- LTR (English) ---------- */
[dir="ltr"] { --font: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif; }
[dir="ltr"] .i-dir { transform: scaleX(-1); }
[dir="ltr"] .select { background-position: right 10px center; padding: 6px 30px 6px 12px; }
[dir="ltr"] .field select { background-position: right 12px center; padding-left: 12px; padding-right: 32px; }
[dir="ltr"] .input.num { text-align: left; }
[dir="ltr"] .page-head h1, [dir="ltr"] h1, [dir="ltr"] h2, [dir="ltr"] h3 { letter-spacing: -.02em; }
[dir="ltr"] .ad-label { letter-spacing: .08em; text-transform: uppercase; }

/* =========================================================================
   Motion, imagery & interaction
   - .motion    : set inline in <head> (skipped for prefers-reduced-motion)
   - .motion-js : set by site.js once it boots
   - .rv        : below-the-fold reveal (content above the fold is never hidden)
   ========================================================================= */

:root { --ease-out: cubic-bezier(.16, 1, .3, 1); --ease-io: cubic-bezier(.65, 0, .35, 1); }

/* soft ambient gold glow at the top of every page */
body {
  background:
    radial-gradient(900px 420px at 85% -120px, color-mix(in srgb, var(--gold-2) 13%, transparent), transparent 70%),
    radial-gradient(700px 360px at 5% -160px, color-mix(in srgb, var(--gold-2) 8%, transparent), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
}

/* ---------- Scroll progress + header ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none;
  background: linear-gradient(90deg, #9A6A1B, #E9C25E, #FFF0BC, #E9C25E);
  transform: scaleX(0); transform-origin: 0 50%; will-change: transform;
}
[dir="rtl"] .scroll-progress { transform-origin: 100% 50%; background: linear-gradient(270deg, #9A6A1B, #E9C25E, #FFF0BC, #E9C25E); }
.header { transition: box-shadow .3s, background-color .3s; }
.header.scrolled {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 8px 28px -14px rgba(14, 18, 22, .28);
}
.header.scrolled .mobile-nav { background: transparent; }
.nav a::before {
  content: ""; position: absolute; inset-inline: 12px; bottom: -1px; height: 2px; border-radius: 2px;
  background: var(--gold-2); transform: scaleX(0); transition: transform .35s var(--ease-out);
}
.nav a:hover::before { transform: scaleX(1); }

/* brand mark bars grow on load */
.motion .brand-mark rect + rect { transform-box: fill-box; transform-origin: 50% 100%; animation: barGrow .9s var(--ease-out) backwards; }
.motion .brand-mark rect:nth-child(3) { animation-delay: .12s; }
.motion .brand-mark rect:nth-child(4) { animation-delay: .24s; }
.brand:hover .brand-mark rect + rect { animation: barBounce .6s var(--ease-out); }
.brand:hover .brand-mark rect:nth-child(3) { animation-delay: .06s; }
.brand:hover .brand-mark rect:nth-child(4) { animation-delay: .12s; }
@keyframes barGrow { from { transform: scaleY(0); } }
@keyframes barBounce { 40% { transform: scaleY(.55); } }

.icon-btn { transition: border-color .2s, color .2s, transform .25s var(--ease-out); }
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { transition: transform .5s var(--ease-out); }
.icon-btn:hover svg { transform: rotate(-25deg); }

/* ---------- Ticker marquee ---------- */
.ticker-viewport {
  flex: 1; min-width: 0; height: 100%; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent);
}
.ticker-track { display: flex; width: max-content; height: 100%; }
.ticker-set { display: flex; height: 100%; }
.ticker-set .tick:first-child { border-inline-start: 1px solid var(--top-line); padding-inline-start: 16px; }
.ticker-track.run { animation: tickerLtr var(--dur, 40s) linear infinite; }
[dir="rtl"] .ticker-track.run { animation-name: tickerRtl; }
.ticker-viewport:hover .ticker-track, .ticker-viewport:focus-within .ticker-track { animation-play-state: paused; }
.tick { transition: background-color .2s; }
a.tick:hover { background: rgba(255, 255, 255, .04); color: var(--top-strong); }
@keyframes tickerLtr { to { transform: translateX(-50%); } }
@keyframes tickerRtl { to { transform: translateX(50%); } }
.dot { position: relative; }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #45C98A; animation: livePulse 2s ease-out infinite; }
@keyframes livePulse { from { transform: scale(1); opacity: .7; } to { transform: scale(3.2); opacity: 0; } }

/* ---------- Reveal on scroll ----------
   Only elements that start BELOW the fold get .rv (added by site.js before they are ever seen),
   so first paint / LCP is never delayed or hidden. */
.rv { opacity: 0; transform: translateY(22px) scale(.985); transition: opacity .8s var(--ease-out), transform .9s var(--ease-out); transition-delay: var(--d, 0ms); }
.rv.in { opacity: 1; transform: none; }
.card.settled { transition: opacity .3s, transform .35s var(--ease-out), box-shadow .35s, border-color .35s; transition-delay: 0ms; }

/* table rows cascade in */
.rv.in .table tbody tr { animation: rowIn .6s var(--ease-out) backwards; animation-delay: calc(var(--d, 0ms) + 120ms + var(--i, 0) * 45ms); }
@keyframes rowIn { from { opacity: 0; transform: translateY(8px); } }

/* sparklines draw themselves */
.motion .spark { animation: sparkDraw 1.4s var(--ease-io) .2s backwards; }
.rv .spark { animation: none; clip-path: inset(0 100% 0 0); transition: clip-path 1.4s var(--ease-io) calc(var(--d, 0ms) + 300ms); }
.rv.in .spark { clip-path: inset(0 0 0 0); }
@keyframes sparkDraw { from { clip-path: inset(0 100% 0 0); } }

/* ---------- Card spotlight & tilt ---------- */
.card { position: relative; }
.card::before, .card::after { content: ""; position: absolute; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s; }
.card::before {
  inset: -1px; padding: 1px; z-index: 2;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), var(--gold-2), transparent 65%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.card::after { inset: 0; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--gold-2) 8%, transparent), transparent 65%); }
.card.lit::before, .card.lit::after { opacity: 1; }

.card.tilt.settled { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px)); transition: transform .25s ease-out, box-shadow .35s, border-color .35s; }
.card.tilt.lit { --lift: -4px; box-shadow: 0 22px 40px -24px rgba(142, 109, 27, .45), 0 0 0 1px color-mix(in srgb, var(--gold-2) 30%, transparent); }

/* ---------- Quote hero + art ---------- */
.quote-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-content: start; overflow: hidden; }
.quote-main > :not(.quote-art) { grid-column: 1; }
.quote-art { grid-column: 2; grid-row: 1 / span 3; align-self: center; width: clamp(96px, 30vw, 172px); height: auto; filter: drop-shadow(0 14px 22px rgba(142, 109, 27, .28)); animation: floatY 6s ease-in-out infinite; pointer-events: none; }
.quote:hover .quote-art { animation-duration: 3s; }
@keyframes floatY { 50% { transform: translateY(-8px) rotate(-1.5deg); } }
.quote-label .tag { position: relative; overflow: hidden; }
.quote-label .tag::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%); transform: translateX(-120%); animation: glint 4.5s ease-in-out 1.2s infinite; }
@keyframes glint { 30%, 100% { transform: translateX(120%); } }
.quote-price .num { background: linear-gradient(100deg, var(--ink) 0 40%, var(--gold-2) 50%, var(--ink) 60% 100%); background-size: 260% 100%; background-position: 0 0; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.motion .quote-price .num { animation: textSheen 1.8s var(--ease-io) .6s backwards; }
@keyframes textSheen { from { background-position: 100% 0; } to { background-position: 0 0; } }
.kv { transition: background-color .25s; }
.kv:hover { background: var(--surface-2); }

/* page-head with illustration (calculators) */
.page-head.has-art { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.page-head-text { min-width: 0; }
.page-art { flex: none; width: 190px; height: auto; margin-block: -14px -8px; filter: drop-shadow(0 16px 24px rgba(142, 109, 27, .25)); animation: floatY 6s ease-in-out infinite; }

/* tool cards */
.tool-art {
  display: grid; place-items: center; height: 104px; margin: -6px -8px 8px; border-radius: 12px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 100%, var(--gold-bg), transparent 70%), var(--surface-2);
  border: 1px solid var(--line-2);
}
.tool-art img { height: 96px; width: auto; transition: transform .6s var(--ease-out); }
.tool:hover .tool-art img { transform: translateY(-5px) scale(1.08); }
.tool h2 { transition: color .2s; }
.tool:hover h2 { color: var(--gold); }

.empty-art { width: 180px; height: auto; margin: 0 auto 18px; animation: floatY 6s ease-in-out infinite; filter: drop-shadow(0 16px 24px rgba(142, 109, 27, .25)); }

/* ---------- Tables ---------- */
.table tbody td { transition: background-color .2s; }
[dir="rtl"] .table tbody tr:hover td:first-child { box-shadow: inset -3px 0 0 var(--gold-2); }
[dir="ltr"] .table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--gold-2); }
.karat-badge { transition: transform .3s var(--ease-out), background-color .3s, color .3s; }
.table tbody tr:hover .karat-badge { transform: scale(1.08); background: var(--gold); color: var(--surface); }
.row-link { transition: color .2s; }
.mini-list a { transition: background-color .2s, padding .3s var(--ease-out); }
.mini-list a:hover { padding-inline-start: 28px; }
@media (max-width: 560px) { .mini-list a:hover { padding-inline-start: 20px; } }

/* ---------- Segmented control pill ---------- */
.seg { position: relative; }
.seg button { position: relative; z-index: 1; transition: color .25s; }
.seg-pill { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 7px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); transition: transform .45s var(--ease-out), width .45s var(--ease-out); }
.seg.has-pill button[aria-pressed="true"] { background: transparent; box-shadow: none; }

/* ---------- Buttons, chips, ripple ---------- */
.btn, .chip, .seg button, .icon-btn, .markets a, .mobile-nav a, .lang-switch a, .pager a { position: relative; overflow: hidden; }
.btn { transition: transform .25s var(--ease-out), box-shadow .25s, opacity .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(14, 18, 22, .5); opacity: 1; }
.btn:active { transform: translateY(0) scale(.98); }
.chip, .pager a, .lang-switch a, .mobile-nav a { transition: border-color .2s, color .2s, background-color .2s, transform .2s var(--ease-out); }
.chip:hover, .pager a:hover { transform: translateY(-1px); }
.markets a { transition: color .2s, border-color .3s; }
.rpl { position: absolute; border-radius: 50%; background: currentColor; opacity: .18; transform: scale(0); pointer-events: none; animation: ripple .65s var(--ease-out) forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* ---------- Live values ---------- */
.bump { display: inline-block; animation: bump .5s var(--ease-out); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.06); color: var(--gold); } 100% { transform: scale(1); } }
.result { transition: border-color .3s, box-shadow .3s; }
.form:focus-within .result { border-color: color-mix(in srgb, var(--gold-2) 45%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold-2) 10%, transparent); }

/* ---------- FAQ ---------- */
.faq summary { transition: color .2s, background-color .2s; }
.faq summary:hover { color: var(--gold); background: var(--surface-2); }
.faq details[open] .answer { animation: faqIn .45s var(--ease-out); }
@keyframes faqIn { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Footer links ---------- */
.footer ul a { display: inline-block; transition: color .2s, transform .25s var(--ease-out); }
[dir="rtl"] .footer ul a:hover { transform: translateX(-4px); }
[dir="ltr"] .footer ul a:hover { transform: translateX(4px); }

@media (max-width: 640px) {
  .page-art { width: 108px; margin: 0; }
  .page-head.has-art { gap: 12px; }
  .quote-art { width: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  .scroll-progress, .quote-art, .page-art { display: none !important; }
  .card { opacity: 1 !important; transform: none !important; }
}
/* ---------- Currency labels ---------- */
.tick-cur { font-size: 11px; color: var(--top-ink); opacity: .8; margin-inline-start: -4px; }
.cur-short { font-size: 12px; font-weight: 400; color: var(--muted); }

/* ---------- Guides ---------- */
.guide-tile h2, .guide-tile h3 { font-size: 16px; line-height: 1.5; }
.guide-tile .tool-art { margin: -6px -8px 6px; }
.guide-tile .link { margin-top: 4px; font-size: 13.5px; }
.guide-body h2 { font-size: 21px; color: var(--ink); margin: 30px 0 12px; line-height: 1.45; }
.guide-body h2::before { content: ""; display: inline-block; width: 6px; height: 18px; border-radius: 3px; background: var(--gold-2); margin-inline-end: 10px; vertical-align: -2px; }
.guide-body ul { padding-inline-start: 22px; margin: 0 0 1.2em; }
.guide-body li { margin-bottom: 8px; }
.guide-body li::marker { color: var(--gold-2); }
.guide-body strong { color: var(--ink); }
.guide-body .table { margin: 6px 0 20px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 15px; }
.guide-body .table th, .guide-body .table td { white-space: normal; padding: 11px 14px; }
.guide-body .note { margin-top: 18px; }
.guide-lead { font-size: 19px !important; color: var(--ink) !important; padding-bottom: 18px; border-bottom: 1px solid var(--line-2); }
.guide-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line-2); }
.section-title { font-size: 18px; margin: 4px 0 14px; }
.card-head .h3 { font-size: 16.5px; }
.mini-list a[aria-current="page"] { color: var(--gold); background: var(--gold-bg); }
.mini-list a .name { line-height: 1.5; }

.guides-strip { margin-top: 16px; }
.guides-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 10px 14px; }
.guides-links a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 500; line-height: 1.5; transition: background-color .2s, color .2s; }
.guides-links a:hover { background: var(--surface-2); color: var(--gold); }
.guides-links img { width: 40px; height: 34px; flex: none; transition: transform .4s var(--ease-out); }
.guides-links a:hover img { transform: scale(1.12) rotate(-4deg); }
@media (max-width: 640px) { .guides-links { grid-template-columns: 1fr; } }

/* ---------- Stale prices banner ---------- */
.stale-banner { background: color-mix(in srgb, #F2B233 16%, var(--surface)); border-bottom: 1px solid color-mix(in srgb, #F2B233 45%, var(--line)); color: var(--ink); font-size: 14px; }
.stale-banner .wrap { display: flex; align-items: center; gap: 10px; padding-block: 10px; }
.stale-banner svg { width: 18px; height: 18px; flex: none; color: #B7791F; }
[data-theme="dark"] .stale-banner svg { color: #F2B233; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stale-banner svg { color: #F2B233; } }

/* ---------- Direct (sponsor) ads ---------- */
.ad-label a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ad-label a:hover { color: var(--gold); }
.ad-sponsor { min-height: 0; }
.ad-sponsor img { display: block; max-width: 100%; height: auto; margin-inline: auto; border-radius: 10px; border: 1px solid var(--line); transition: transform .3s var(--ease-out), box-shadow .3s; }
.ad-sponsor a:hover img { transform: translateY(-2px); box-shadow: 0 12px 26px -14px rgba(14, 18, 22, .45); }

/* ---------- Currencies ---------- */
.fx-conv-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto minmax(0, 1.3fr); gap: 12px; align-items: end; }
.fx-swap { width: 42px; height: 42px; border-radius: 12px; }
.fx-swap svg { width: 18px; height: 18px; }
.fx-swap:hover svg { transform: rotate(180deg); }
.fx-result { gap: 6px; }
.fx-result .link { margin-top: 4px; }
.fx-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 22px 22px; }
.fx-chips a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 500; transition: border-color .2s, color .2s, transform .2s var(--ease-out); }
.fx-chips a:hover { border-color: var(--gold-2); color: var(--gold); transform: translateY(-1px); }
.fx-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.fx-amounts .table td, .fx-amounts .table th { padding-inline: 18px; }
.fx-source { margin: 0; }
.fx-source a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 860px) {
  .fx-conv-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .fx-conv-row .field:first-child { grid-column: 1 / -1; }
  .fx-amounts { grid-template-columns: 1fr; }
}
