:root {
  color: #171d2e;
  background: #f4f6fb;
  font-family: Inter, Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --navy: #171f33;
  --purple: #5c40df;
  --muted: #596379;
  --line: #e3e7f0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
a { color: inherit; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #8775f5;
  outline-offset: 3px;
}
.top { background: var(--navy); color: #fff; }
.top-inner, main, footer { max-width: 980px; margin: auto; padding-inline: clamp(16px, 4vw, 34px); }
.top-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1rem; font-weight: 720; }
.brand-mark { display: grid; place-items: center; background: #a494ff; color: #18122f; border-radius: 10px; width: 34px; height: 34px; font-size: .84rem; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.environment { border-radius: 100px; color: #e1d9ff; background: #332b53; padding: 6px 10px; font-size: .73rem; }
.language { border: 1px solid #505974; border-radius: 9px; color: #fff; background: transparent; padding: 7px 10px; }
main { padding-top: 34px; }
.welcome { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.eyebrow { color: var(--purple); text-transform: uppercase; letter-spacing: .11em; font-weight: 750; font-size: .76rem; margin: 0 0 7px; }
h1 { font-size: clamp(1.9rem, 5vw, 2.75rem); letter-spacing: -.045em; margin: 0; line-height: 1.1; }
h2 { margin: 0; font-size: 1.2rem; }
.market { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; color: var(--muted); font-size: .81rem; }
select, input { background: #fff; color: #171d2e; border: 1px solid #cbd2e1; border-radius: 9px; padding: 11px 12px; min-height: 44px; }
select { width: 100%; min-width: 0; text-overflow: ellipsis; }
@supports (appearance: base-select) and selector(::picker(select)) {
  /* Keep the picker anchored to the page in Chrome's device emulation. */
  select, select::picker(select) { appearance: base-select; }
  select { align-items: center; }
  .market { min-width: 10rem; }
  select::picker(select) {
    width: anchor-size(width);
    max-height: min(18rem, 50dvh);
    overflow-y: auto;
    border: 1px solid #cbd2e1;
    border-radius: 9px;
    background: #fff;
    color: #171d2e;
    box-shadow: 0 8px 24px #2d1e5526;
  }
  select option { padding: 10px 12px; white-space: normal; overflow-wrap: anywhere; }
  select option:checked { background: #f3efff; }
  select option:hover, select option:focus-visible { background: #e8dfff; }
}
.balance-card {
  display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 18px;
  border-radius: 19px; background: linear-gradient(110deg,#251c51,#402b9f); color: #fff;
  padding: clamp(20px, 4vw, 30px); box-shadow: 0 12px 24px #2d1e551c;
}
.balance-info p { color: #e0d7ff; font-size: .9rem; margin: 0 0 7px; }
.balance-info strong { font-size: clamp(1.8rem, 6vw, 3.1rem); letter-spacing: -.04em; overflow-wrap: anywhere; }
#currency { margin-left: 9px; color: #ded4ff; font-weight: 640; }
.actions { display: flex; gap: 10px; }
.primary, .secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px;
  padding: 11px 17px; min-height: 44px; border: 1px solid transparent; font-weight: 700; text-decoration: none;
}
.primary { background: var(--purple); color: #fff; }
.primary:hover { background: #4c30c8; }
.balance-card .primary { background: #fff; color: #382293; }
.secondary { background: #ffffff16; color: #fff; border-color: #ffffff70; }
.panel { margin-top: 23px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(16px, 3.4vw, 26px); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#record-count, .empty, small { color: var(--muted); }
.empty { margin-bottom: 3px; }
.close, .quick button { border: 1px solid var(--line); background: #f7f7fd; color: #37258f; padding: 7px 12px; border-radius: 8px; min-height: 36px; }
#order-form { margin-top: 19px; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-bottom: 13px; font-weight: 620; max-width: 410px; }
.field small { font-weight: 400; }
.quick { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
fieldset { border: 0; margin: 0 0 15px; padding: 0; min-width: 0; }
legend { margin-bottom: 8px; font-weight: 620; }
.methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 9px; }
.method { display: flex; align-items: center; gap: 9px; text-align: start; min-height: 65px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #20253b; }
.method[aria-pressed="true"] { border-color: var(--purple); background: #f4f1ff; }
.method-logo, .order-icon { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; background: #eee9ff; color: #4229b5; display: grid; place-items: center; font-weight: 700; object-fit: contain; }
.method small { display: block; margin-top: 3px; }
.form-message { color: #9c3531; margin: 0 0 9px; }
.message { border: 1px solid #ead6b0; border-radius: 10px; background: #fff7e6; margin-bottom: 14px; padding: 10px 13px; }
.order { border-top: 1px solid var(--line); }
.order:first-child { margin-top: 15px; }
.order summary { display: grid; grid-template-columns: 34px minmax(0,1fr) minmax(0,auto); gap: 11px; align-items: center; padding: 12px 0; list-style: none; }
.order summary::-webkit-details-marker { display: none; }
.order-label, .order-value { display: grid; gap: 4px; overflow-wrap: anywhere; }
.order-value { text-align: right; }
.status { border-radius: 100px; width: fit-content; justify-self: end; padding: 3px 8px; background: #fff1ca; color: #6f4d09; font-weight: 660; }
.status.succeeded { background: #ddfaee; color: #176346; }
.status.failed { background: #fee6e4; color: #8f2923; }
.success-pulse { animation: success-pulse .65s ease-out; }
@keyframes success-pulse { 0% { transform: scale(.83); } 52% { transform: scale(1.14); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .success-pulse { animation: none; } }
.order-detail { padding: 0 0 17px 45px; }
.order-reference { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.timeline { margin: 8px 0 13px; padding-left: 20px; }
.timeline li { padding: 4px 0; }
.timeline time { color: var(--muted); font-size: .75rem; margin-left: 8px; }
footer { color: var(--muted); font-size: .79rem; padding-block: 22px; }
.checkout { display: grid; min-height: 100svh; place-items: center; }
.checkout main { padding: 24px; margin: 18px; background: white; border-radius: 16px; border: 1px solid var(--line); }
@media (max-width: 540px) {
  main { padding-top: 24px; }
  .actions { width: 100%; }
  .actions button { flex: 1; }
  .market { width: 100%; }
  .market select { font-size: 1rem; }
  .top-inner { min-height: 60px; }
  .order-detail { padding-left: 0; }
}
