:root {
  --bg: #0a0c0f;
  --card: #12161c;
  --border: #1c222b;
  --text: #f0f4f8;
  --muted: #8a96a3;
  --primary: #f3ba2f;
  --primary-h: #e0a820;
  --primary-text: #0a0c0f;
  --danger: #ef4444;
  --ok: #22c55e;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}

.wrap {
  max-width: 440px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.lang-switch {
  position: absolute;
  top: 16px;
  right: 16px;
}
#lang-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1.4rem;
  padding: 4px 8px;
  cursor: pointer;
}
#lang-menu {
  position: absolute;
  right: 0;
  top: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  z-index: 10;
}
#lang-menu div {
  padding: 10px 16px;
  cursor: pointer;
  white-space: nowrap;
}
#lang-menu div:hover { background: #222; }
header {
  position: relative;
  text-align: center;
  margin-bottom: 24px;
  padding-top: 4px;
}
.logo { margin: 0; }
.menu-btn {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 1.2rem;
  cursor: pointer;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  line-height: 1;
  z-index: 10;
  height: 36px;
}
.lang-switch {
  position: absolute;
  top: 0;
  right: 0;
}
.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100%;
  background: #11141a;
  border-right: 1px solid var(--border);
  z-index: 200;
  padding: 20px 0;
}
.side-header {
  font-weight: 700;
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.side-menu a {
  display: block;
  padding: 12px 20px;
  color: var(--text);
  text-decoration: none;
}
.side-menu a:hover { background: #1a1e26; }
.logo {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.logo span {
  color: var(--primary);
  font-weight: 700;
}
.sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

.warn {
  background: #3b1d1d;
  border: 1px solid #7f1d1d;
  color: #fecaca;
  border-radius: 12px;
  padding: 12px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  text-align: center;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.label { color: var(--muted); font-size: 0.9rem; }
.acct { color: var(--ok); font-weight: 600; font-size: 0.9rem; }
.acct.on { display: inline; }
.bal { color: var(--muted); font-size: 0.85rem; margin-top: 8px; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 13px 14px;
  font-size: 1rem;
  outline: none;
}
.field input:focus { border-color: var(--primary); }

.input-row {
  display: flex;
  gap: 8px;
}
.input-row input { flex: 1; }

.btn {
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
}
.btn.primary {
  background: var(--primary);
  color: var(--primary-text);
}
.btn.primary:hover { background: var(--primary-h); }
.btn.secondary {
  background: #1c222b;
  color: var(--text);
}
.btn.tiny {
  padding: 0 14px;
  font-size: 0.8rem;
  background: var(--primary);
  color: var(--primary-text);
  font-weight: 700;
}
.btn.full { width: 100%; margin-top: 6px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btns {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.btns .btn { flex: 1; }

.err {
  color: var(--danger);
  font-size: 0.85rem;
  min-height: 1.2em;
  margin: 6px 0;
  word-break: break-word;
}

.hidden { display: none; }

.confirm-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.confirm-row span { color: var(--muted); flex-shrink: 0; }
.confirm-row b { text-align: right; word-break: break-all; }
.break { word-break: break-all; font-size: 0.8rem; }

.note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 12px 0;
}

footer {
  text-align: center;
  margin-top: 28px;
}
.powered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}
.small {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}
.powered a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.powered a:hover { opacity: 0.85; }
.powered svg { flex-shrink: 0; }

.rates h3 { margin-bottom: 10px; }
.rates-list { display: flex; flex-direction: column; gap: 8px; }
.rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.rate-row:last-child { border-bottom: none; }
.rate-name { display: flex; align-items: center; gap: 8px; }
.rate-logo {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #1c222b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
}
.tx-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.tx-row:last-child { border-bottom: none; }
.tx-top, .tx-bottom {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
}
.tx-mid {
  margin: 4px 0;
  font-weight: 600;
  color: var(--primary);
}
.tx-row { cursor: pointer; }
.tx-details {
  margin-top: 8px;
  padding: 8px;
  background: #11141a;
  border-radius: 8px;
  font-size: 0.75rem;
  word-break: break-all;
}
.tx-details a { color: #8ab4f8; text-decoration: none; }
.tx-details a:hover { text-decoration: underline; }
.tx-details div { margin: 4px 0; }
.rate-price.updated { color: #fff; }
.loading { color: var(--muted); justify-content: center; }
