:root {
    --bg: #0a0a0a;
    --card: #141414;
    --card-2: #1c1c1c;
    --line: #2a2a2a;
    --text: #f5f5f5;
    --muted: #8f8f8f;
    --accent: #3ddc97;
    --secondary: #3ddc97; /* wordmark "exchange"; alternatives: #5ac8fa sky, #a78bfa lavender */
    --accent-ink: #062b1c;
    --danger: #ff5c5c;
    --warn: #ffb02e;
    --radius: 16px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { color-scheme: dark; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.45;
    min-height: 100vh;
    padding: 0 16px;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 0.9em; word-break: break-all; }

/* header */
.top {
    max-width: 640px; margin: 0 auto; padding: 18px 0 8px;
    display: flex; align-items: center; justify-content: space-between;
}
.brand { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.03em; text-decoration: none; }
.brand-tld { color: var(--secondary); }
.top nav { display: flex; gap: 18px; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.top nav a:hover { color: var(--text); }

main { max-width: 640px; margin: 0 auto; padding-bottom: 48px; }
.pitch {
    margin-top: 28px; font-size: clamp(1.9rem, 6vw, 2.6rem); font-weight: 800;
    letter-spacing: -0.03em; line-height: 1.1; text-align: center;
}
.sub { color: var(--muted); text-align: center; margin: 12px auto 24px; max-width: 460px; }

/* card */
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; max-width: 460px; margin: 0 auto;
}
.field { margin-bottom: 8px; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.field-head label { color: var(--muted); font-size: 0.85rem; }
.hint { color: var(--muted); font-size: 0.8rem; text-align: right; }
.hint.bad { color: var(--danger); }
.hint.good { color: var(--accent); }
.row {
    display: flex; align-items: stretch; gap: 8px;
    background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 14px;
}
.row:focus-within { border-color: #4a4a4a; }
.row input {
    flex: 1; min-width: 0; background: none; border: 0; outline: 0;
    font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em;
}
.row input::placeholder { color: #4d4d4d; }
.row input[readonly] { color: var(--text); }
.coin {
    display: flex; align-items: center; gap: 8px; background: #262626; border: 0; border-radius: 10px;
    padding: 6px 10px 6px 8px; white-space: nowrap;
}
.coin:hover { background: #303030; }
.coin img { width: 28px; height: 28px; border-radius: 50%; background: #333; }
.coin-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.coin-text b { font-size: 1rem; }
.coin-text small { color: var(--muted); font-size: 0.72rem; }
.chev { color: var(--muted); font-size: 0.8rem; }
.flip-row { display: flex; justify-content: center; margin: -2px 0 6px; }
.flip {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card-2);
    font-size: 1.1rem; line-height: 1;
}
.flip:hover { background: #262626; }
.rate-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.85rem; margin: 10px 2px 12px; gap: 12px; }
#rate-meta { white-space: nowrap; }

.flow { display: flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.flow button { flex: 1; border: 0; background: none; border-radius: 8px; padding: 8px; color: var(--muted); font-size: 0.9rem; }
.flow button[aria-checked="true"] { background: #2a2a2a; color: var(--text); font-weight: 600; }
.flow-note { color: var(--muted); font-size: 0.8rem; margin: 8px 2px 14px; min-height: 1.2em; }

.primary {
    width: 100%; padding: 15px; border: 0; border-radius: 12px;
    background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 1.05rem;
}
.primary:disabled { background: #2a2a2a; color: #6a6a6a; cursor: not-allowed; }
.primary.busy { opacity: 0.7; cursor: progress; }
.error { color: var(--danger); font-size: 0.9rem; margin: 0 2px 12px; }

/* details step */
.back { background: none; border: 0; color: var(--muted); padding: 0; margin-bottom: 10px; font-size: 0.9rem; }
.back:hover { color: var(--text); }
.summary { font-weight: 600; margin-bottom: 16px; }
.step-details .field input, .refund input {
    width: 100%; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px;
    padding: 12px 14px; outline: 0; font-family: var(--mono); font-size: 0.95rem;
}
.step-details .field input:focus { border-color: #4a4a4a; }
.step-details .field input.bad { border-color: var(--danger); }
.step-details .field input.good { border-color: var(--accent); }
.field-note { color: var(--muted); font-size: 0.8rem; margin-top: 6px; }
.refund { margin: 6px 0 14px; }
.refund summary { color: var(--muted); font-size: 0.9rem; cursor: pointer; margin-bottom: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; color: var(--muted); margin-bottom: 14px; }
.check input { margin-top: 4px; accent-color: var(--accent); }

/* tx step */
.tx-head { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: 0.85rem; margin-bottom: 12px; gap: 10px; }
.tx-head b { color: var(--text); }
.banner { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 0.95rem; background: #1f1f1f; border: 1px solid var(--line); }
.banner.ok { border-color: var(--accent); }
.banner.warn { border-color: var(--warn); }
.banner.bad { border-color: var(--danger); }
.banner b { display: block; margin-bottom: 4px; }
.deposit { text-align: center; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.deposit-title { font-size: 1.05rem; }
.deposit-net { color: var(--muted); font-size: 0.9rem; margin: 4px 0 12px; }
.deposit-net b { color: var(--warn); }
.qr { display: block; margin: 0 auto 12px; width: 200px; height: 200px; border-radius: 10px; background: #fff; padding: 6px; }
.addr-row { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 8px; flex-wrap: wrap; }
.addr-row code { font-family: var(--mono); font-size: 0.85rem; word-break: break-all; text-align: left; }
.copy { border: 1px solid var(--line); background: #262626; border-radius: 8px; padding: 6px 12px; font-size: 0.85rem; }
.copy.done { border-color: var(--accent); color: var(--accent); }
.countdown { color: var(--warn); font-size: 0.9rem; margin-top: 6px; }
.deposit-note { color: var(--muted); font-size: 0.8rem; margin-top: 10px; }

.steps { list-style: none; display: flex; justify-content: space-between; gap: 4px; margin: 4px 0 16px; counter-reset: s; }
.steps li { flex: 1; text-align: center; font-size: 0.72rem; color: var(--muted); position: relative; padding-top: 18px; }
.steps li::before {
    content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
    width: 10px; height: 10px; border-radius: 50%; background: #333;
}
.steps li.done::before { background: var(--accent); }
.steps li.active { color: var(--text); font-weight: 600; }
.steps li.active::before { background: var(--accent); box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.25); }
.steps li.bad::before { background: var(--danger); }
.facts { display: grid; gap: 8px; font-size: 0.9rem; margin-bottom: 14px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; }
.facts dt { color: var(--muted); white-space: nowrap; }
.facts dd { text-align: right; }
.facts a { color: var(--accent); }
.tx-help { color: var(--muted); font-size: 0.8rem; margin-bottom: 14px; }

/* recent */
.recent { max-width: 460px; margin: 20px auto 0; }
.recent h2 { font-size: 0.85rem; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.recent ul { list-style: none; display: grid; gap: 6px; }
.recent a { display: flex; justify-content: space-between; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; }
.recent a span:last-child { color: var(--muted); }

/* content */
.how, .faq { max-width: 460px; margin: 44px auto 0; }
h2 { font-size: 1.2rem; letter-spacing: -0.02em; margin-bottom: 12px; }
.how ol { list-style: none; display: grid; gap: 10px; counter-reset: how; }
.how li { position: relative; padding-left: 36px; color: var(--muted); counter-increment: how; }
.how li b { color: var(--text); }
.how li::before {
    content: counter(how); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
    background: var(--card-2); border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
}
.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); margin-top: 8px; font-size: 0.95rem; }

footer {
    max-width: 640px; margin: 0 auto; padding: 20px 0 32px; border-top: 1px solid var(--line);
    display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 0.8rem;
}
footer a { color: var(--muted); }
footer a:first-of-type { margin-left: auto; } /* copyright left, Terms and Privacy right */

/* picker */
.picker { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.picker-panel {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
    width: 100%; max-width: 460px; max-height: 80vh; display: flex; flex-direction: column;
}
.picker-head { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.picker-head input {
    flex: 1; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: 0;
}
.picker-head button { width: 42px; border: 1px solid var(--line); background: var(--card-2); border-radius: 10px; }
#picker-list { list-style: none; overflow-y: auto; padding: 6px; }
#picker-list li { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; cursor: pointer; }
#picker-list li:hover, #picker-list li.focus { background: var(--card-2); }
#picker-list img { width: 30px; height: 30px; border-radius: 50%; background: #333; }
#picker-list .pk-text { display: flex; flex-direction: column; line-height: 1.15; }
#picker-list .pk-text small { color: var(--muted); }
#picker-list .pk-net { margin-left: auto; color: var(--muted); font-size: 0.75rem; background: #262626; padding: 3px 8px; border-radius: 6px; }
#picker-list .empty { color: var(--muted); cursor: default; justify-content: center; }

@media (min-width: 560px) {
    .picker { align-items: center; }
    .picker-panel { border-radius: var(--radius); max-height: 70vh; }
}

/* pages */
.page { max-width: 640px; margin: 0 auto; padding-bottom: 48px; }
.page h1 { font-size: 1.8rem; letter-spacing: -0.03em; margin: 24px 0 6px; }
.page .updated { color: var(--muted); font-size: 0.85rem; margin-bottom: 20px; }
.page h2 { margin-top: 24px; font-size: 1.1rem; }
.page p, .page li { color: #cfcfcf; margin-top: 8px; }
.page ul { padding-left: 20px; }
