:root, [data-theme="white"] {
  --bg: #ffffff; --surface: #f5f3ff; --card: #ffffff; --line: #e9e5fb; --text: #14121f; --muted: #6b6880;
  --accent: #6d4bff; --on-accent: #ffffff;
  --hero: linear-gradient(135deg, #6d4bff 0%, #4f46e5 100%); --on-hero: #ffffff;
  --ok: #16a34a; --warn: #d97706; --info: #6d4bff; --bad: #dc2626;
}
[data-theme="white"] .bottom a.on { color: #6d4bff; }
[data-theme="white"] .hero { box-shadow: 0 18px 40px -20px rgba(109, 75, 255, .55); }
/* Giftoia — default brand theme: deep navy + violet */
[data-theme="violet"] {
  --bg: #0a0c12; --surface: #0f131c; --card: #141926; --line: #232a3a; --text: #eaecf3; --muted: #8b92a6;
  --accent: #7c5cff; --on-accent: #ffffff;
  --hero: linear-gradient(135deg, #6d4bff 0%, #4f46e5 100%); --on-hero: #ffffff;
  --ok: #22c55e; --warn: #f59e0b; --info: #a48bff; --bad: #ef4444;
}
[data-theme="violet"] body {
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(124, 92, 255, .14), transparent 60%),
    radial-gradient(900px 600px at 0% 110%, rgba(236, 72, 153, .10), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
[data-theme="violet"] .top { background: rgba(10, 12, 18, .82); backdrop-filter: blur(10px); }
[data-theme="violet"] .bottom { background: rgba(15, 19, 28, .92); backdrop-filter: blur(10px); }
[data-theme="violet"] .hero { box-shadow: 0 18px 40px -18px rgba(109, 75, 255, .7); }
[data-theme="violet"] .btn:not(.ghost):not(.tg) { background: linear-gradient(135deg, #7c5cff, #4f46e5); }
[data-theme="violet"] .bottom .sell-btn span { background: linear-gradient(135deg, #7c5cff, #4f46e5); box-shadow: 0 0 0 6px rgba(124, 92, 255, .22), 0 10px 24px -8px rgba(124, 92, 255, .8); }
[data-theme="violet"] .values button.on { border-color: #a48bff; }
[data-theme="violet"] .bottom a.on { color: #a48bff; }
[data-theme="violet"] .offers { background: linear-gradient(90deg, #6d4bff, #4f46e5); }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; }
body { padding-bottom: 96px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
main { max-width: 560px; margin: 0 auto; padding: 8px 16px 24px; }
h1 { font-size: 28px; margin: 12px 0 16px; }
h2 { font-size: 18px; margin: 20px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--bg); max-width: 560px; margin: 0 auto; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -.5px; }
.top-actions { display: flex; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; min-width: 38px; height: 38px; padding: 0 10px; display: grid; place-items: center; cursor: pointer; }

.offers { overflow: hidden; background: var(--accent); color: var(--on-accent); font-size: 14px; white-space: nowrap; }
.offers-track { display: inline-block; padding: 7px 0; animation: marquee 22s linear infinite; }
.offers-track span { margin: 0 28px; }
@keyframes marquee { from { transform: translateX(100vw); } to { transform: translateX(-100%); } }
[dir="rtl"] .offers-track { animation-name: marquee-rtl; }
@keyframes marquee-rtl { from { transform: translateX(-100vw); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .offers-track { animation: none; } }

.hero { background: var(--hero); color: var(--on-hero); border-radius: 24px; padding: 22px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; width: 260px; height: 110px; border: 1px solid currentColor; opacity: .18; border-radius: 50%; right: -60px; top: 20px; transform: rotate(-18deg); }
.hero .big { font-size: 42px; font-weight: 800; letter-spacing: -1px; }
.hero .big small { font-size: 18px; font-weight: 600; }
.hero .row { display: flex; justify-content: space-between; align-items: center; }
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; position: relative; z-index: 1; }
.hero-actions a, .hero-actions button { background: color-mix(in srgb, var(--on-hero) 16%, transparent); border: 0; border-radius: 999px; padding: 12px; text-align: center; color: var(--on-hero); cursor: pointer; font-weight: 600; }

.ticker { display: flex; justify-content: space-between; padding: 12px 4px; color: var(--muted); font-size: 14px; }
.box { background: var(--surface); border-radius: 18px; padding: 14px; margin: 8px 0; }
.box .inner { background: var(--card); border-radius: 14px; padding: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.btn { display: inline-block; border: 0; background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 12px 18px; font-weight: 700; cursor: pointer; text-align: center; }
.btn.ghost { background: transparent; color: var(--text); border: 1.5px solid var(--text); }
.btn.block { display: block; width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

.list { list-style: none; margin: 0; padding: 0; }
.list li a, .list li button.rowbtn { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; cursor: pointer; text-align: start; }
.logo { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none; background: var(--surface); border: 1px solid var(--line); }
.grow { flex: 1; min-width: 0; }
.name { font-size: 17px; }
.arrow { color: var(--text); }
.arrow { display: inline-block; }
.hero .arrow, .btn .arrow { color: inherit; }
[dir="rtl"] .arrow { transform: scaleX(-1); }
.hot { font-size: 12px; background: var(--accent); color: var(--on-accent); border-radius: 6px; padding: 1px 6px; margin-inline-start: 6px; }

.search { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 12px 18px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tile { cursor: pointer; background: none; border: 0; padding: 0; text-align: start; }
.tile .face { aspect-ratio: 1.6; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 22px; position: relative; overflow: hidden; color: #fff; }
.tile .face .rate { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 13px; font-weight: 500; padding: 4px 10px; }
.tile .label { display: block; font-weight: 600; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.values button { border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 14px 0; font-weight: 700; cursor: pointer; }
.values button.on { border-color: var(--text); background: var(--accent); color: var(--on-accent); }
.quote { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.quote div { background: var(--surface); border-radius: 14px; padding: 12px; }
.quote b { display: block; font-size: 22px; }
textarea, .input { width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 14px; resize: vertical; }
textarea:focus, .input:focus { outline: none; border-color: var(--text); }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 6px; }
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--text); }

.order { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.order .head { display: flex; gap: 12px; align-items: center; }
.order .sub { background: var(--surface); border-radius: 12px; padding: 10px 12px; margin-top: 10px; font-size: 14px; }
.order .sub .line { display: flex; justify-content: space-between; color: var(--muted); }
.st { font-weight: 700; font-size: 14px; white-space: nowrap; }
.st.RECEIVED, .st.PENDING { color: var(--warn); } .st.USING { color: var(--info); } .st.COMPLETED, .st.PAID { color: var(--ok); } .st.REJECTED { color: var(--bad); }

.tx { display: flex; justify-content: space-between; padding: 12px 2px; border-bottom: 1px solid var(--line); gap: 10px; }
.tx .amt.pos { color: var(--ok); } .tx .amt.neg { color: var(--bad); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats div { background: var(--surface); border-radius: 14px; padding: 12px; }
.stats b { display: block; font-size: 20px; }
.copy { display: flex; gap: 8px; } .copy input { flex: 1; }
.menu { background: var(--surface); border-radius: 18px; padding: 0 16px; margin-top: 16px; }
.menu .list li:last-child a, .menu .list li:last-child button.rowbtn { border-bottom: 0; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs button { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin-top: 8px; }

.bottom { position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; background: var(--surface); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); z-index: 6; }
.bottom a { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--muted); gap: 2px; }
.bottom a span { font-size: 20px; line-height: 1; }
.bottom a.on { color: var(--text); font-weight: 700; }
.bottom .sell-btn span { width: 62px; height: 62px; margin-top: -30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 28px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent); }
.fab { position: fixed; inset-inline-end: 0; top: 45%; background: var(--accent); color: var(--on-accent); padding: 10px 12px; opacity: .92; border-start-start-radius: 22px; border-end-start-radius: 22px; font-size: 22px; z-index: 6; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 110px; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; z-index: 10; font-size: 14px; }

.logo.img { width: 42px; height: 56px; border-radius: 7px; background: var(--surface); overflow: hidden; padding: 0; border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.18); margin-inline: 3px; }
.logo.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .face.hasimg { background: #111; border: 0; }
.tile .face.hasimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; max-height: none; margin: 0; }
.eye { background: none; border: 0; color: inherit; font-size: 20px; cursor: pointer; vertical-align: middle; padding: 0 4px; }
.ticker { align-items: center; overflow: hidden; }
.ticker #tick { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: fadein .4s; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }
a.order { display: block; }
.timeline { list-style: none; padding: 0; margin: 0 0 14px; }
.timeline li { position: relative; padding: 0 0 18px; padding-inline-start: 30px; display: flex; flex-direction: column; color: var(--muted); }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 6px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.timeline li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 11px; top: 18px; bottom: 2px; width: 2px; background: var(--line); }
.timeline li.on { color: var(--text); }
.timeline li.on::before { background: var(--text); }
.timeline li.on.COMPLETED::before { background: var(--ok); }
.timeline li.on.REJECTED::before { background: var(--bad); }
.timeline li.on.USING::before { background: var(--info); }
.faq { border-bottom: 1px solid var(--line); padding: 14px 2px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); margin: 8px 0 0; }

.auth-buttons { display: grid; gap: 10px; margin: 18px 0 6px; }
.gbtn { min-height: 44px; display: flex; justify-content: center; }
.btn.tg { background: #229ED9; color: #fff; }
.sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.code-input { font-size: 26px; letter-spacing: 10px; text-align: center; font-family: ui-monospace, Consolas, monospace; }
.list.methods li.method { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.list.methods .btn { padding: 8px 14px; }

.custom-amt { margin-top: 12px; }
.custom-amt .copy { align-items: center; }
.custom-amt .cur { font-weight: 700; font-size: 20px; }
.custom-amt .input { font-size: 20px; font-weight: 700; }

.cur-pick { background: color-mix(in srgb, var(--on-hero) 16%, transparent); color: var(--on-hero); border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 700; cursor: pointer; position: relative; z-index: 1; }
.cur-pick option { color: #111; }
.approx { margin-top: 2px; font-size: 15px; opacity: .9; }
.hero-link { display: inline-block; margin-top: 8px; opacity: .85; position: relative; z-index: 1; }

.usage-inline { font-size: 13px; font-weight: 400; color: var(--muted); white-space: nowrap; vertical-align: middle; margin-inline-start: 6px; }

.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand img { border-radius: 7px; }
