/* ============================================================
   Black & gold theme
   ============================================================ */
@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

:root {
  --bg: #09090a;
  --bg-2: rgba(0, 0, 0, .38);
  --surface: rgba(24, 22, 19, .72);
  --surface-solid: #141311;
  --surface-2: #1d1b17;
  --line: rgba(214, 170, 76, .16);
  --line-strong: rgba(214, 170, 76, .42);
  --gold: #d6aa4c;
  --gold-hi: #f7e1a1;
  --gold-lo: #8c6519;
  --gold-grad: linear-gradient(135deg, #f7e1a1 0%, #d6aa4c 40%, #a87b22 70%, #f0d58a 100%);
  --text: #f4efe4;
  --muted: #9b9385;
  --faint: #5f594f;
  --ok: #5fd39a;
  --bad: #ef7a6c;
  --r: 20px;
  --r-sm: 13px;
  --font: 'Manrope', 'Noto Sans Arabic', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Cinzel', Georgia, serif;
  --tab-h: 66px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  background:
    radial-gradient(120% 55% at 50% -12%, rgba(214, 170, 76, .17), transparent 62%),
    radial-gradient(70% 45% at 110% 105%, rgba(214, 170, 76, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
html[dir="rtl"] body { font-family: 'Noto Sans Arabic', var(--font); }

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input { font: inherit; color: inherit; }
svg { display: block; }

#dust { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

.app {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto;
  padding: 14px 16px calc(var(--tab-h) + 32px + env(safe-area-inset-bottom));
}

/* ---------- Header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.emblem { width: 42px; height: 42px; flex: none; filter: drop-shadow(0 4px 14px rgba(214, 170, 76, .35)); }
.brand-text { min-width: 0; }
.brand-name {
  font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: .06em;
  background: linear-gradient(100deg, #a87b22 0%, #f7e1a1 25%, #d6aa4c 45%, #fff3c9 55%, #d6aa4c 70%, #a87b22 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s ease-in-out infinite;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@keyframes shimmer { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
.brand-tag { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; margin-top: 1px; }

.lang-btn {
  display: flex; align-items: center; gap: 6px; flex: none;
  height: 36px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: rgba(214, 170, 76, .07);
  color: var(--gold-hi); font-weight: 700; font-size: 13px; letter-spacing: .04em;
  transition: background .2s;
}
.lang-btn:active { background: rgba(214, 170, 76, .18); }
.lang-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.status-row { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 0 rgba(95, 211, 154, .6); animation: pulse 2s infinite; }
.dot.warn { background: var(--gold); }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(95, 211, 154, 0); } 100% { box-shadow: 0 0 0 0 rgba(95, 211, 154, 0); } }

/* ---------- Views ---------- */
.view { display: none; animation: rise .35s ease both; }
.view.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.h1 { font-family: var(--display); font-size: 22px; letter-spacing: .04em; margin: 14px 0 2px; color: var(--gold-hi); font-weight: 700; }
html[dir="rtl"] .h1 { font-family: 'Noto Sans Arabic', var(--font); }
.sub-h { margin: 0 0 12px; color: var(--muted); font-size: 13px; }

/* ---------- Cards ---------- */
.card {
  position: relative;
  margin-top: 12px; padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.card[hidden] { display: none; }

.swap-card { padding: 12px; box-shadow: 0 20px 60px -30px rgba(214, 170, 76, .35); }
.swap-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--ang), transparent 0 55%, rgba(247, 225, 161, .9) 72%, var(--gold) 80%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 7s linear infinite; pointer-events: none;
}
@keyframes spin { to { --ang: 360deg; } }

.label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.label.sub { margin-top: 14px; }
html[dir="rtl"] .label { letter-spacing: 0; }

/* ---------- Exchange fields ---------- */
.field { background: var(--bg-2); border: 1px solid rgba(255, 255, 255, .04); border-radius: 15px; padding: 11px 12px 12px 14px; }
.field-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.hint { color: var(--faint); }
.hint.bad { color: var(--bad); }
.field-row { display: flex; align-items: center; gap: 10px; }
.amount {
  flex: 1; min-width: 0; width: 100%;
  background: none; border: 0; outline: 0;
  font-size: 27px; font-weight: 800; letter-spacing: -.01em;
  color: var(--text); padding: 2px 0;
}
.amount::placeholder { color: var(--faint); }

.asset-btn {
  display: flex; align-items: center; gap: 8px; flex: none;
  height: 42px; padding: 0 10px 0 5px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  font-weight: 800; font-size: 15px;
  transition: border-color .2s, transform .15s;
}
html[dir="rtl"] .asset-btn { padding: 0 5px 0 10px; }
.asset-btn:active { transform: scale(.97); border-color: var(--line-strong); }
.asset-btn .chev { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; }

.swap-btn {
  position: relative; z-index: 2;
  display: grid; place-items: center;
  width: 42px; height: 42px; margin: -9px auto; border-radius: 50%;
  background: var(--gold-grad); color: #1a1406;
  border: 4px solid #151410;
  box-shadow: 0 6px 18px -4px rgba(214, 170, 76, .55);
  transition: transform .35s cubic-bezier(.3, 1.5, .5, 1);
}
.swap-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.swap-btn.turn { transform: rotate(180deg); }

.rate-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 4px 2px; font-size: 13px; color: var(--muted); }
.rate-line b { color: var(--gold-hi); font-weight: 700; }
.timer { color: var(--faint); font-size: 12px; white-space: nowrap; }

/* ---------- Coin badges ---------- */
.coin {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: #fff; line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
}
.coin.fiat {
  background: radial-gradient(circle at 30% 25%, #2a2518, #0d0c0a);
  color: var(--gold-hi); box-shadow: inset 0 0 0 1px var(--line-strong);
  font-family: var(--font);
}
.coin.sm { width: 26px; height: 26px; font-size: 12px; }
.coin.lg { width: 38px; height: 38px; font-size: 17px; }
.coin.long { font-size: 10px; }

/* ---------- Chips / methods ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .02);
  font-size: 13px; font-weight: 600; color: var(--muted);
  transition: all .18s;
}
.chip.active { border-color: var(--gold); background: rgba(214, 170, 76, .13); color: var(--gold-hi); }

.methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.method {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  min-height: 74px; padding: 10px 6px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .02);
  font-size: 12.5px; font-weight: 700; color: var(--muted); text-align: center;
  transition: all .18s;
}
.method svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.method.active {
  color: var(--gold-hi); border-color: var(--gold);
  background: linear-gradient(160deg, rgba(214, 170, 76, .2), rgba(214, 170, 76, .04));
  box-shadow: 0 8px 22px -14px rgba(214, 170, 76, .8);
}

.net-group + .net-group { margin-top: 14px; }

.text-input {
  width: 100%; padding: 14px; border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px solid var(--line); outline: 0;
  font-size: 15px; transition: border-color .2s;
}
.text-input:focus { border-color: var(--gold); }
.text-input::placeholder { color: var(--faint); }
.text-input.bad { border-color: var(--bad); }

.err { min-height: 20px; margin: 10px 4px 0; font-size: 13px; color: var(--bad); }

/* ---------- Gold button ---------- */
.gold-btn {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 56px; margin-top: 4px; border-radius: 17px;
  background: var(--gold-grad); color: #1a1406;
  font-weight: 800; font-size: 16px; letter-spacing: .02em;
  box-shadow: 0 14px 34px -14px rgba(214, 170, 76, .75), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .15s, filter .2s;
}
.gold-btn:active { transform: scale(.985); filter: brightness(.95); }
.gold-btn::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg); animation: shine 4s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -60%; } 85%, 100% { left: 130%; } }
.gold-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gold-btn.ghost { background: transparent; color: var(--gold-hi); border: 1px solid var(--line-strong); box-shadow: none; margin-top: 14px; }
.gold-btn.ghost::after { display: none; }

.fine { margin: 10px 6px 0; font-size: 12px; color: var(--faint); text-align: center; }

/* ---------- Steps ---------- */
.steps ol { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; color: var(--text); }
.steps li + li { border-top: 1px dashed rgba(214, 170, 76, .1); }
.steps li::before {
  content: counter(s); flex: none;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-strong); color: var(--gold-hi); font-size: 12px; font-weight: 800;
  background: rgba(214, 170, 76, .07);
}

/* ---------- Rates list ---------- */
.list { padding: 4px 14px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.row + .row { border-top: 1px solid rgba(255, 255, 255, .05); }
.row .name { flex: 1; min-width: 0; }
.row .name b { display: block; font-size: 15px; }
.row .name small { color: var(--muted); font-size: 12px; }
.chg { font-size: 11.5px; font-weight: 700; margin-inline-start: 6px; }
.chg.up { color: var(--ok); }
.chg.down { color: var(--bad); }
.px { text-align: end; font-variant-numeric: tabular-nums; }
.px div { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.px span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-inline-end: 6px; }
.px .sell { color: var(--gold-hi); }
.rates-head { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Methods view ---------- */
.cur-card .cur-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cur-card .cur-head b { font-size: 16px; }
.cur-card .cur-head small { display: block; color: var(--muted); font-size: 12.5px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 10px; font-size: 12.5px; font-weight: 700;
  background: rgba(214, 170, 76, .1); color: var(--gold-hi); border: 1px solid var(--line);
}
.tag svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.banks { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* ---------- Help ---------- */
.hero-247 { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 14px; }
.big-247 {
  font-family: var(--display); font-size: 34px; font-weight: 700;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.faq details {
  margin-top: 10px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); overflow: hidden;
}
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 15px 16px; font-weight: 700; font-size: 14.5px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-size: 20px; font-weight: 400; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 16px 16px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; z-index: 20; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(11, 11, 12, .86);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: var(--faint);
  transition: color .2s;
}
.tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--gold-hi); }
.tab.active::before {
  content: ""; position: absolute; top: -1px; left: 30%; right: 30%; height: 2px; border-radius: 2px;
  background: var(--gold-grad); box-shadow: 0 0 12px 1px rgba(214, 170, 76, .7);
}

/* ---------- Sheet ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .62);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 31; left: 50%; bottom: 0;
  width: 100%; max-width: 480px; max-height: 86vh; overflow-y: auto;
  transform: translate(-50%, 105%);
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #1a1814, var(--surface-solid) 120px);
  border-top: 1px solid var(--line-strong); border-radius: 24px 24px 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .6);
  transition: transform .32s cubic-bezier(.2, .9, .3, 1);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--faint); margin: 2px auto 12px; }
.sheet h2 { margin: 2px 0 12px; font-size: 18px; color: var(--gold-hi); }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 13px; background: var(--bg-2); border: 1px solid var(--line); margin: 10px 0 6px; }
.seg button { height: 34px; border-radius: 9px; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.seg button.active { background: rgba(214, 170, 76, .16); color: var(--gold-hi); }

.pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 6px; border-radius: 12px; text-align: start; }
.pick:active { background: rgba(214, 170, 76, .08); }
.pick .name { flex: 1; min-width: 0; }
.pick .name b { display: block; }
.pick .name small { color: var(--muted); font-size: 12.5px; }
.pick .check { width: 20px; height: 20px; fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.pick.active .check { visibility: visible; }
.pick.active { background: rgba(214, 170, 76, .07); }

/* Order sheet */
.order-id { font-family: var(--display); color: var(--gold-hi); font-size: 20px; letter-spacing: .05em; }
.sum { margin: 14px 0; border-radius: 16px; border: 1px solid var(--line); background: var(--bg-2); }
.sum div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 14px; font-size: 14px; }
.sum div + div { border-top: 1px solid rgba(255, 255, 255, .05); }
.sum span { color: var(--muted); flex: none; }
.sum b { text-align: end; word-break: break-all; }
.sum .big b { color: var(--gold-hi); font-size: 16px; }
.order-hint { color: var(--muted); font-size: 13.5px; margin: 0 2px 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 40; left: 50%; bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 999px;
  background: #221f19; border: 1px solid var(--line-strong); color: var(--gold-hi);
  font-size: 13.5px; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  transition: all .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
