* { box-sizing: border-box; }
:root {
  --bg: #0f131a;
  --text: #e7eef7;
  --panel: #1b2331;
  --panel-2: #151b26;
  --border: #2a3548;
  --accent: #2e7de9;
  --muted: #9fb3c8;
  --input-bg: #0f131a;
  --btn-bg: #2e7de9;
  --buy: #4d8b31;
  --sell: #a23a3a;
  --good: #7ad27a;
  --bad: #e07a7a;
  --scroll-track: #121826;
  --scroll-thumb: #2e7de9;
  --scroll-thumb-hover: #3a8df5;
  --chart-bg: #0f131a;
}
body.theme-light {
  --bg: #e3e8f0;
  --text: #1b2430;
  --panel: #f2f5f9;
  --panel-2: #e7edf5;
  --border: #b8c4d6;
  --accent: #1f6feb;
  --muted: #5a6a80;
  --input-bg: #f2f5f9;
  --btn-bg: #1f6feb;
  --buy: #2f7d32;
  --sell: #c0392b;
  --good: #2f7d32;
  --bad: #c0392b;
  --scroll-track: #cfd8e6;
  --scroll-thumb: #7aa0d8;
  --scroll-thumb-hover: #5f8fce;
  --chart-bg: #eef2f7;
}
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.hidden {
  display: none !important;
}
header, footer {
  padding: 20px;
  background: var(--panel-2);
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
header h1 { margin: 0 0 6px 0; }
.brand-title { margin: 0; line-height: 1; }
.brand-logo {
  display: block;
  height: 44px;
  width: auto;
}
.brand p { margin: 0; }
.brand-title + p { margin-top: 4px; }
.hero-tagline {
  background: linear-gradient(90deg, #1e1b4b 0%, #4c1d95 20%, #7c3aed 40%, #0e7490 60%, #7c3aed 80%, #1e1b4b 100%);
  background-size: 500% 100%;
  animation: tagline-gradient 240s ease infinite;
  text-align: center;
  padding: 14px 20px;
  position: relative;
  box-shadow: 0 4px 16px rgba(14, 116, 144, 0.2), 0 2px 8px rgba(124, 58, 237, 0.3);
}
@keyframes tagline-gradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.hero-tagline span {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.4), 0 0 40px rgba(45, 212, 191, 0.3);
  position: relative;
}
@media (max-width: 600px) {
  .hero-tagline { padding: 10px 16px; }
  .hero-tagline span { font-size: 0.9rem; }
}
.header-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  flex: 1;
  min-width: 0;
}
.brand-link {
  display: inline-flex;
  flex: 0 0 auto;
  color: inherit;
  text-decoration: none;
}
.brand-link:hover {
  color: inherit;
}
.auth-only {
  display: none !important;
}
.authed .auth-only {
  display: revert !important;
}
.authed .guest-only {
  display: none !important;
}
.fee-only {
  display: none !important;
}
body.is-admin .fee-only {
  display: revert !important;
}
.wallet-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
.wallet-status a {
  text-decoration: none;
}
.wallet-status a:hover,
.wallet-status a:focus {
  text-decoration: none;
}
.wallet-status.inline {
  margin-left: 8px;
  gap: 6px;
}
.wallet-status.inline .wallet-chip {
  padding: 4px 8px;
  font-size: 11px;
}
.wallet-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
}
.wallet-chip .wallet-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
}
.wallet-chip.offline {
  border-color: var(--bad);
  color: var(--bad);
}
.wallet-chip.offline .wallet-dot {
  background: var(--bad);
}
.wallet-chip .wallet-text {
  white-space: nowrap;
}
.top-nav {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}
.top-nav > a {
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--input-bg);
}
.top-nav a.home-link {
  display: inline-block;
}
.nav-btn {
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  cursor: pointer;
}
.top-nav > a:hover {
  border-color: var(--accent);
}
.nav-btn:hover {
  border-color: var(--accent);
}
.top-nav .notif-wrapper {
  flex: 0 0 auto;
  margin-left: 6px;
}
.notif-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  z-index: 80;
}
.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}
.notif-bell svg {
  width: 18px;
  height: 18px;
}
.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #d84b4b;
  color: #fff;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.notif-dropdown {
  position: absolute;
  right: 0;
  left: auto;
  top: calc(100% + 8px);
  width: 320px;
  min-width: 320px;
  max-width: min(420px, calc(100vw - 16px));
  max-height: 360px;
  overflow: auto;
  overflow-x: hidden;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: none;
  z-index: 9999;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
}
.notif-wrapper.open .notif-dropdown {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 10px;
}
.notif-dropdown .notif-item {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex-shrink: 0;
}
.notif-dropdown a {
  color: var(--text);
  text-decoration: none;
}
.notif-dropdown a:link,
.notif-dropdown a:visited,
.notif-dropdown a:hover,
.notif-dropdown a:active {
  color: var(--text);
  text-decoration: none;
}
.notif-item * {
  color: inherit;
  text-decoration: none !important;
}
.notif-dropdown a:visited {
  color: var(--text);
}
.notif-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  text-decoration: none;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}
.notif-item:hover {
  border-color: var(--accent);
  background: var(--panel-2);
}
.notif-title {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.92rem;
}
.notif-body {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
  word-break: break-word;
}
.notif-time {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 4px;
}
.notif-dropdown::-webkit-scrollbar {
  width: 8px;
}
.notif-dropdown::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 999px;
}
.notif-dropdown::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 2px solid var(--scroll-track);
}
.notif-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}
.notif-empty {
  color: var(--muted);
  text-align: center;
  padding: 10px 6px;
}
.menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.menu-toggle {
  width: 40px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.menu-toggle:hover {
  border-color: var(--accent);
}
.burger {
  position: relative;
  width: 18px;
  height: 2px;
  background: var(--text);
}
.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--text);
}
.burger::before { top: -6px; }
.burger::after { top: 6px; }
.menu-items {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  display: none;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  padding: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 20;
}
.menu.open .menu-items {
  display: flex;
}
.menu-items a,
.menu-items .nav-btn {
  width: 100%;
  text-align: left;
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
}
.menu-items a:hover,
.menu-items .nav-btn:hover {
  border-color: var(--accent);
}
.menu-items a:focus-visible,
.menu-items .nav-btn:focus-visible,
.top-nav a:focus-visible,
.top-nav .nav-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
body.notif-open .top-nav {
  overflow-x: visible;
}
.top-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}
.top-nav a:not(.notif-item),
.top-nav .nav-btn:not(.notif-bell) {
  width: auto;
  text-align: center;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
@media (min-width: 721px) {
  .top-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    gap: 6px;
  }
  .top-nav > a,
  .top-nav > .nav-btn,
  .top-nav > .notif-wrapper > .nav-btn {
    padding: 6px 10px;
    font-size: 0.95rem;
  }
  .top-nav::-webkit-scrollbar {
    height: 6px;
  }
  .top-nav::-webkit-scrollbar-track {
    background: var(--scroll-track);
    border-radius: 999px;
  }
  .top-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--scroll-thumb), var(--accent));
    border-radius: 999px;
    border: 2px solid var(--scroll-track);
  }
  .top-nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, var(--scroll-thumb-hover), var(--accent));
  }
}
.trade-processing {
  display: none;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  color: var(--muted);
}
.trade-processing.show {
  display: block;
}
section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  padding: 16px;
}
@media (min-width: 900px) {
  #faucet {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  }
}
#faucet .faucet-verify #hcaptcha,
#faucet .faucet-verify .h-captcha {
  max-width: 100%;
}
#chart {
  grid-template-columns: 1fr;
}
#auth {
  grid-template-columns: minmax(260px, 420px);
  justify-content: center;
}
#deposit-page {
  grid-template-columns: minmax(260px, 520px);
  justify-content: center;
}
#wallets {
  position: relative;
}
.wallet-locked {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(10, 12, 16, 0.7);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.wallet-locked-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  max-width: 360px;
  width: 100%;
  text-align: center;
}
body.wallet-locked #wallets .card {
  pointer-events: none;
  opacity: 0.35;
}
body.wallet-locked #wallets .wallet-locked {
  display: flex;
}
#orders-page {
  grid-template-columns: minmax(280px, 980px);
  justify-content: center;
}
#fees-page {
  grid-template-columns: minmax(280px, 1100px);
  justify-content: center;
}
.chart-card {
  min-height: 420px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 10px;
  min-height: 180px;
}
.card[data-loading="1"] > :not(h2):not(.card-skeleton) {
  opacity: 0;
  pointer-events: none;
}
.card .card-skeleton {
  display: none;
}
.card[data-loading="1"] .card-skeleton {
  display: block;
}
.card-skeleton .skeleton-line {
  height: 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, #1a2230 25%, #233043 50%, #1a2230 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  margin: 10px 0;
}
.card-skeleton .skeleton-line.short {
  width: 45%;
}
.card-skeleton .skeleton-line.medium {
  width: 70%;
}
.card-skeleton .skeleton-line.long {
  width: 90%;
}
.card h2 {
  margin-top: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-title-row h2 {
  margin: 0;
}
.export-csv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
  color: var(--fg);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
  white-space: nowrap;
}
.export-csv-btn:hover {
  border-color: var(--accent);
  background: var(--panel-2);
}
.help-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  background: var(--panel-2);
  position: relative;
}
.help-icon[title]:hover::after,
.help-icon[title]:focus::after {
  content: attr(title);
  position: absolute;
  right: 0;
  top: 26px;
  width: min(280px, 70vw);
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.35;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.full-width {
  grid-column: 1 / -1;
}
.span-2 {
  grid-column: span 2;
}
.wallet-row {
  display: grid;
  gap: 16px;
}
.wallet-row.full-width {
  grid-column: 1 / -1;
}
.trade-row {
  display: grid;
  gap: 16px;
}
.trade-row.full-width {
  grid-column: 1 / -1;
}
@media (min-width: 900px) {
  .wallet-row {
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
    align-items: start;
  }
  .trade-row {
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
    align-items: start;
  }
}
.pair-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pair-title span:first-of-type {
  font-weight: 700;
}
.pair-links {
  font-weight: 600;
  opacity: 0.9;
}
.pair-link {
  color: var(--text);
  text-decoration: none;
}
.pair-link:visited {
  color: var(--text);
}
.pair-link:hover {
  color: var(--accent);
  text-decoration: underline;
}
.pair-links {
  white-space: nowrap;
}
/* Faucet donate layout */
.faucet-addr {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 10px;
}
.faucet-addr-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
}
.faucet-addr-row .muted {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.faucet-addr-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.faucet-addr-line code {
  display: block;
  padding: 8px 10px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  word-break: break-all;
}
.addr-copy-btn {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  min-height: 34px;
}
.addr-copy-btn:hover {
  color: var(--accent);
}
.faucet-onsite {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 10px;
}
.faucet-onsite-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.faucet-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 0.85rem;
}
.faucet-pill .pill-label {
  color: var(--muted);
  font-weight: 600;
}
.claim-btn-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}
.claim-btn {
  position: relative;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}
.claim-btn.claim-ready {
  border-color: #2ecc71;
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.4), inset 0 0 0 1px rgba(46, 204, 113, 0.3);
  animation: claim-pulse 2s ease-in-out infinite;
}
.claim-btn.claim-waiting {
  border-color: rgba(231, 76, 60, 0.6);
  opacity: 0.85;
}
@keyframes claim-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(46, 204, 113, 0.4), inset 0 0 0 1px rgba(46, 204, 113, 0.3); }
  50% { box-shadow: 0 0 20px rgba(46, 204, 113, 0.6), inset 0 0 0 1px rgba(46, 204, 113, 0.5); }
}
.claim-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.85rem;
  min-height: 1.4em;
  padding: 4px 12px;
  border-radius: 12px;
  width: fit-content;
  margin: 0 auto;
}
.claim-btn.claim-ready + .claim-timer {
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.1);
  font-weight: 500;
}
.claim-btn.claim-waiting + .claim-timer {
  color: var(--muted);
  background: rgba(231, 76, 60, 0.08);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  letter-spacing: 1px;
}
.claim-check {
  font-size: 1.1em;
  font-weight: bold;
}
.claim-clock {
  font-size: 0.95em;
  opacity: 0.7;
}
.faucet-verified-status {
  padding: 12px 16px;
  background: var(--panel);
  border-radius: 8px;
  text-align: center;
  font-size: 1rem;
  color: var(--good);
  border: 1px solid var(--good);
}
.verified-check {
  font-size: 1.2em;
  font-weight: bold;
  margin-right: 6px;
}
.faucet-donate {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.faucet-donate-available {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  margin: 8px 0 10px;
}
.faucet-donate-available .faucet-pill {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.faucet-donate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.faucet-donate-row input {
  min-width: 0;
}
.faucet-donate-row button {
  white-space: nowrap;
  min-width: 120px;
}
.rain-balances {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.rain-info {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
  margin: 0 0 6px;
}
.rain-eligible-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  padding: 8px 14px;
  border-radius: 20px;
  margin: 8px 0 12px;
}
.rain-eligible-count {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  min-width: 1.5em;
  text-align: center;
}
.rain-eligible-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rain-stats-line {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 8px 0 4px;
  opacity: 0.85;
}
.rain-stats-line::before {
  content: "☔";
  margin-right: 6px;
  font-size: 0.9em;
}
.rain-stats-line .rain-stat-val {
  font-weight: 600;
  color: #6cb6ff;
}
.rain-total {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.rain-total-label {
  color: var(--muted);
}
.rain-total-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rain-pill {
  font-size: 0.9rem;
}
.rain-total-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.rain-total-val {
  color: var(--text);
  font-weight: 600;
}
.rain-total-asset {
  color: var(--muted);
  margin-left: 2px;
}
.rain-available {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.rain-available .faucet-pill {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.rain-controls {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.rain-controls select,
.rain-controls input {
  min-width: 0;
}
.rain-controls button {
  white-space: nowrap;
  min-width: 120px;
}
@media (max-width: 600px) {
  .faucet-addr-line code {
    font-size: 0.85rem;
  }
  .faucet-addr-line {
    grid-template-columns: 1fr;
  }
  .addr-copy-btn {
    width: 100%;
  }
  .faucet-donate-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .faucet-donate-row button {
    width: 100%;
  }
  .rain-controls {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .rain-controls button {
    width: 100%;
  }
  .rain-available .faucet-pill {
    width: 100%;
    justify-content: space-between;
  }
  .faucet-donate-available .faucet-pill {
    width: 100%;
    justify-content: space-between;
  }
}
.inline-link,
.inline-link:link,
.inline-link:visited,
.inline-link:active {
  color: var(--accent) !important;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}
.inline-link:hover {
  color: #6cb6ff !important;
  text-decoration: underline;
}
.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: var(--border);
  border-radius: 50%;
  cursor: help;
  vertical-align: middle;
}
.tooltip-icon:hover {
  color: var(--text);
  background: var(--accent);
}
.wd-tooltip {
  cursor: help;
}
@media (max-width: 600px) {
  .pair-title {
    gap: 4px;
    line-height: 1.1;
    font-size: 1.02rem;
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  .pair-title img {
    margin-top: 2px;
  }
}
.pair-logo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}
.order-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
#wallets .order-metric {
  justify-content: flex-start;
}
#wallets .order-metric .metric-btn {
  margin-left: auto;
  min-width: 180px;
  text-align: right;
}
@media (max-width: 720px) {
  #wallets .order-metric {
    justify-content: space-between;
  }
  #wallets .order-metric .metric-btn {
    min-width: 0;
    text-align: right;
  }
}
.donate-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.donate-balance {
  margin-left: auto;
  text-align: right;
  min-width: 160px;
}
.metric-btn {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
}
.metric-btn:hover {
  color: var(--accent);
}
.order-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.order-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.order-input .unit {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  min-width: 44px;
  text-align: right;
}
.order-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 10px;
}
.tz-actions button {
  width: auto;
  min-width: 140px;
}
.lang-time {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 16px;
}
.lang-time .subhead {
  margin: 0 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.lang-time .lang-block,
.lang-time .time-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lang-time select {
  width: 100%;
}
.lang-time #lang-status,
.lang-time #tz-status,
.lang-time #tz-preview {
  margin-top: 4px;
}
.lang-time #tz-status,
.lang-time #tf-status {
  display: none;
}
.lang-time .tz-actions {
  margin: 2px 0 6px;
}
.lang-time .tz-actions button {
  padding: 8px 10px;
}
.lang-time .tz-actions button.active {
  border-color: #2ecc71 !important;
  box-shadow: 0 0 0 1px #2ecc71 inset !important;
}
.lang-time-divider {
  display: block;
  height: 1px;
  background: var(--border);
  width: 100%;
  grid-column: 1 / -1;
  margin: 6px 0 2px;
}
@media (max-width: 720px) {
  .lang-time {
    grid-template-columns: 1fr;
  }
}
.lang-time .tz-actions {
  flex-wrap: nowrap;
}
.lang-time .tz-actions button {
  flex: 1 1 0;
  min-width: 0;
}
.order-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
}
.order-sort select {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 8px;
}
.order-book-mini {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.order-book-mini h3 {
  margin: 0 0 6px 0;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
}
.order-book-mini .data-table {
  max-height: 220px;
  overflow-y: auto;
}
.buy-now-btn,
.sell-now-btn {
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
}
.buy-now-btn:hover,
.sell-now-btn:hover {
  border-color: var(--accent);
}
.buy-btn {
  background: var(--buy);
  color: var(--text);
}
.sell-btn {
  background: var(--sell);
  color: var(--text);
}
.link-btn {
  display: inline-block;
  margin-top: 8px;
  text-decoration: none;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 6px;
}
.link-btn:hover {
  border-color: var(--accent);
}
.auth-links {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.oauth-buttons {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}
.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  text-align: center;
}
.oauth-logo {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.oauth-logo svg {
  width: 18px;
  height: 18px;
  display: block;
}
.oauth-btn.google {
  border-color: var(--border);
}
.oauth-btn.microsoft {
  border-color: var(--border);
}
.oauth-btn:hover {
  border-color: var(--accent);
}
.divider {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 6px 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.oauth-note {
  margin: 0 0 8px 0;
  font-size: 12px;
}
.good {
  color: var(--good);
}
.bad {
  color: var(--bad);
}
input.input-error,
select.input-error {
  border-color: var(--bad) !important;
  outline-color: var(--bad);
  box-shadow: 0 0 0 2px rgba(224, 122, 122, 0.3);
}
input.input-valid,
select.input-valid {
  border-color: var(--good) !important;
  outline-color: var(--good);
}
.captcha-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0;
  flex-wrap: wrap;
}
.captcha-row button {
  width: auto;
  padding: 6px 10px;
}
#recaptcha {
  min-height: 78px;
}
#hcaptcha {
  max-width: 100%;
  overflow: visible;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
}
#hcaptcha iframe {
  width: 304px;
  max-width: 100%;
}
@media (max-width: 420px) {
  #hcaptcha iframe {
    transform: scale(0.9);
    transform-origin: 0 0;
  }
}
@media (max-width: 360px) {
  #hcaptcha iframe {
    transform: scale(0.85);
    transform-origin: 0 0;
  }
}
@media (max-width: 480px) {
  .captcha-row {
    flex-direction: column;
    align-items: stretch;
  }
  .captcha-row button {
    width: 100%;
  }
}
input, select, button {
  width: 100%;
  margin: 6px 0;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
}
textarea {
  width: 100%;
  margin: 6px 0;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  resize: vertical;
}
button {
  cursor: pointer;
  background: var(--btn-bg);
  border: none;
}
pre {
  background: var(--input-bg);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 6px;
  overflow: auto;
  max-height: 260px;
}
.site-footer {
  margin-top: 20px;
  padding: 18px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.site-footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.site-footer .footer-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.site-footer .footer-links a {
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
}
.site-footer .footer-links a:hover,
.site-footer .footer-links a:focus-visible {
  color: var(--text);
  border-color: var(--accent);
}
.site-footer .footer-copy {
  color: var(--muted);
}
.site-footer .footer-stats {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 4px 0;
}

/* Announcement banner */
.announcement-banner {
  background: var(--accent);
  color: #fff;
  padding: 10px 50px 10px 16px;
  text-align: center;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.4;
}
.announcement-banner a {
  color: #fff;
  text-decoration: underline;
}
.announcement-banner .banner-dismiss {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 8px;
  margin: 0 !important;
  opacity: 0.8;
  line-height: 1;
  width: auto;
  left: auto;
}
.announcement-banner .banner-dismiss:hover {
  opacity: 1;
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
}
.data-table.scrollable {
  max-height: 320px;
  overflow: auto;
}
.data-table {
  width: 100%;
  overflow-x: auto;
}
.data-table.compact {
  overflow-x: visible;
}
.data-table.compact table {
  min-width: 0;
  table-layout: fixed;
}
.data-table.compact th,
.data-table.compact td {
  word-break: break-word;
}
.data-table.compact th,
.data-table.compact td {
  text-align: left;
  vertical-align: top;
}
.data-table.compact tr {
  display: block;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.data-table.compact tbody tr:last-child {
  border-bottom: 0;
}
/* Compliance alert rows */
.data-table tr.alert-unack {
  background: rgba(220, 53, 69, 0.15);
}
.data-table tr.alert-unack td {
  color: #ff6b6b;
  font-weight: 500;
}
.data-table.compact th {
  display: block;
  padding: 0 0 4px 0;
  width: 100%;
}
.data-table.compact td {
  display: block;
  padding: 0;
  width: 100%;
}
.data-table table {
  min-width: 520px;
}
.trades-scroll {
  max-height: 360px;
  overflow-y: auto;
}
@media (max-width: 720px) {
  .trades-scroll {
    max-height: 300px;
  }
}
.my-trades-scroll {
  max-height: 400px;
  overflow-y: auto;
}
@media (max-width: 720px) {
  .my-trades-scroll {
    max-height: 340px;
  }
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
}
.chart-left {
  display: flex;
  align-items: center;
  gap: 6px 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.pair-title {
  margin: 0;
}
.wallet-status-inline {
  display: none;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.chart-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.wallet-status-slot {
  display: flex;
  align-items: center;
  margin-left: auto;
  order: 2;
}
.usd-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 0;
  flex: 1 1 auto;
  min-width: 0;
  order: 1;
}
.usd-badges {
  display: none;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.usd-badges.show {
  display: flex;
}
.usd-chip {
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.usd-chip:hover,
.usd-chip:focus {
  text-decoration: none;
  color: var(--text);
}
.usd-chip:visited {
  text-decoration: none;
  color: var(--muted);
}
.usd-badges a,
.usd-badges a:hover,
.usd-badges a:focus,
.usd-badges a:visited {
  text-decoration: none;
}
@media (max-width: 980px) {
  .chart-right {
    width: 100%;
    justify-content: flex-end;
  }
  body:not(.usd-on) .chart-right {
    display: none;
  }
  body:not(.usd-on) .wallet-status-inline {
    display: inline-flex;
  }
  body.usd-on .wallet-status-inline {
    display: none;
  }
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}
.toggle-label {
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toggle-label.wrap {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  background: var(--border);
}
.status-badge.enabled {
  background: color-mix(in srgb, var(--good) 20%, transparent);
  color: var(--good);
}
.status-badge.disabled {
  background: color-mix(in srgb, var(--bad) 20%, transparent);
  color: var(--bad);
}
.card-description {
  margin-bottom: 12px;
  line-height: 1.5;
}
.withdraw-email-actions {
  margin: 12px 0;
}
.withdraw-email-actions button {
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.withdraw-email-actions button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  opacity: 0.85;
}
.btn-danger {
  background: var(--bad);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  opacity: 0.85;
}
.notify-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}
.notify-row select,
.notify-row input {
  width: 100%;
}
.notify-actions {
  margin-top: 12px;
}
.notify-actions button {
  width: 100%;
}
.notify-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--panel);
  margin-top: 12px;
}
.notify-block > .muted:first-child {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.notify-block .muted:not(:first-child) {
  font-size: 0.85rem;
  margin-top: 6px;
}
.notify-divider {
  border-top: 1px solid var(--border);
  margin: 16px 0 12px;
}
.notify-types-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.push-toggle-row {
  margin-bottom: 4px;
}
.notify-row button:last-child {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
}
.notify-row button:last-child:hover {
  background: var(--border);
}
.twofa-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.twofa-actions button {
  width: auto;
}
.twofa-setup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding: 20px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.twofa-qr {
  display: flex;
  justify-content: center;
}
.twofa-qr img {
  width: 200px;
  height: 200px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}
.twofa-secret-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.twofa-secret-row .muted {
  font-size: 0.85rem;
}
.twofa-secret-row code {
  background: var(--input-bg);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 8px;
  word-break: break-all;
  font-size: 0.9rem;
  font-family: monospace;
  letter-spacing: 0.5px;
  text-align: center;
  max-width: 100%;
}
.twofa-secret-row button {
  width: 100%;
  max-width: 200px;
}
.twofa-verify {
  display: flex;
  gap: 8px;
  align-items: center;
}
.twofa-verify input {
  flex: 1 1 auto;
}
.twofa-code-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  width: 100%;
  max-width: 320px;
}
.twofa-setup .twofa-code-row {
  margin-top: 0;
}
#twofa-disable-row {
  margin: 12px auto 0;
}
.twofa-code-row input {
  flex: 1 1 auto;
}
.twofa-code-row button {
  width: auto;
}
.twofa-stores {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}
.twofa-store-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 10px;
  padding: 8px 12px;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.twofa-store-link:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--panel-2);
}
.twofa-store-img {
  height: 32px;
  width: auto;
  display: block;
}
.twofa-backups {
  margin-top: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  padding: 14px;
  border-radius: 10px;
}
.twofa-codes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
  margin-top: 6px;
}
.twofa-code {
  background: var(--input-bg);
  border: 1px solid var(--border);
  padding: 6px 8px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.9rem;
}
/* API Keys */
#api-keys-card[data-loading="1"] > :not(h2):not(.card-skeleton):not(p) {
  opacity: 0;
  pointer-events: none;
}
.api-keys-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}
.api-keys-list::-webkit-scrollbar {
  width: 6px;
}
.api-keys-list::-webkit-scrollbar-track {
  background: var(--panel-2);
  border-radius: 3px;
}
.api-keys-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.api-keys-list::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
.api-keys-list:empty {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.api-key-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.api-key-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.api-key-label {
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
}
.api-key-id-row {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
}
.api-key-id {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--input-bg);
  padding: 3px 8px;
  border-radius: 4px;
  transition: filter 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex-shrink: 1;
}
.api-key-id.blurred {
  filter: blur(5px);
  user-select: none;
}
.api-key-item .api-key-show-btn,
.api-key-item .api-key-copy-btn {
  all: unset;
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 26px !important;
  height: 26px;
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: 4px;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
  flex-shrink: 0;
  background: var(--input-bg);
}
.api-key-item .api-key-show-btn:hover,
.api-key-item .api-key-copy-btn:hover {
  opacity: 1;
  background: var(--border);
}
.api-key-perms {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  align-items: center;
}
.api-key-perm-check {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  width: auto !important;
}
.api-key-perm-check:has(input:checked) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.api-key-perm-check input[type="checkbox"] {
  width: 14px !important;
  height: 14px;
  accent-color: #fff;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.api-key-perm {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
}
.api-key-perm.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.api-key-meta {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.api-key-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.api-key-actions button {
  padding: 6px 14px;
  font-size: 0.85rem;
  width: auto !important;
  flex: 0 0 auto;
}
.api-key-actions .api-key-toggle {
  background: var(--btn-bg);
  color: var(--text);
  border-radius: 6px;
}
.api-key-actions .api-key-delete {
  background: var(--sell);
  color: #fff;
  border-radius: 6px;
}
.api-keys-create {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-top: 16px;
}
.api-keys-create .subhead {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.api-keys-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.api-key-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.api-key-field-label {
  font-size: 0.85rem;
  color: var(--muted);
}
.api-key-field input {
  padding: 10px 12px;
  font-size: 0.95rem;
}
.api-key-perms-form {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 0;
}
.api-key-perm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.api-key-perm-toggle:has(input:checked) {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
}
.api-key-perm-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}
.api-key-perm-toggle label {
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  color: var(--fg);
}
#api-key-create-btn {
  margin-top: 8px;
  padding: 12px 24px;
  font-size: 0.95rem;
  width: 100%;
}
.api-key-secret-box {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 18px;
  margin-top: 16px;
}
.api-key-secret-warning {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 14px;
  font-size: 0.95rem;
}
.api-key-secret-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  flex-wrap: wrap;
}
.api-key-secret-label {
  min-width: 50px;
  font-size: 0.85rem;
  color: var(--muted);
}
.api-key-secret-row code {
  flex: 1;
  min-width: 200px;
  font-size: 0.85rem;
  background: var(--input-bg);
  padding: 8px 12px;
  border-radius: 6px;
  word-break: break-all;
  border: 1px solid var(--border);
}
.api-key-secret-box button.small-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  width: auto !important;
  flex: 0 0 auto;
}
#api-key-secret-done {
  margin-top: 14px;
  padding: 10px 24px;
  width: auto !important;
}
#api-keys-status {
  margin-top: 12px;
}
@media (max-width: 480px) {
  .api-key-header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
  .api-key-label {
    flex: 1;
  }
  .api-key-id-row {
    width: 100%;
    order: 1;
    margin-top: 8px;
    flex-wrap: wrap;
  }
  .api-key-id {
    white-space: normal;
    word-break: break-all;
    overflow: visible;
    text-overflow: unset;
    flex-shrink: 0;
    width: 100%;
    margin-bottom: 6px;
  }
  .api-key-item .api-key-show-btn,
  .api-key-item .api-key-copy-btn {
    flex-shrink: 0;
  }
  .api-key-perms-form {
    flex-direction: column;
    gap: 12px;
  }
  .api-key-secret-row code {
    min-width: 100%;
  }
}
@media (max-width: 720px) {
  .notify-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .notify-row input[type="number"] {
    grid-column: 1 / -1;
  }
  .notify-row button {
    grid-column: span 1;
  }
  .span-2 {
    grid-column: span 1;
  }
  .twofa-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .twofa-verify {
    flex-direction: column;
    align-items: stretch;
  }
  .twofa-code-row {
    flex-direction: column;
    align-items: stretch;
  }
}
.saved-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0;
}
.saved-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.saved-controls select {
  min-width: 180px;
}
.saved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.saved-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: var(--panel);
}
.saved-block.is-hidden {
  display: none;
}
.saved-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}
.saved-list::-webkit-scrollbar {
  width: 6px;
}
.saved-list::-webkit-scrollbar-track {
  background: var(--panel-2);
  border-radius: 3px;
}
.saved-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.saved-list::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
.saved-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
}
.saved-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.saved-label {
  font-weight: 600;
}
.saved-address {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.saved-remove {
  white-space: nowrap;
}
.chart-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.chart-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.chart-label select {
  width: auto;
}
.chart-now {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0 0;
}
.chart-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 220px));
  gap: 10px;
  margin: 10px 0 8px 0;
  justify-content: start;
}
@media (max-width: 640px) {
  .chart-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chart-stats .stat:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}
.login-warning {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: var(--input-bg);
  color: var(--muted);
  text-align: center;
  text-decoration: none;
}
.login-warning.show {
  display: flex;
}
.login-warning:hover {
  border-color: var(--accent);
}
.info-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
}
.warn-text {
  font-size: 12px;
}
.addr-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--input-bg), var(--panel-2));
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.addr-btn + .addr-btn {
  margin-top: 8px;
}
.addr-btn:hover {
  border-color: var(--accent);
}
.addr-row {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.addr-label {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  min-width: 56px;
}
.addr-btn[data-label="Address"] {
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.addr-copy-btn,
.addr-qr-btn {
  width: auto;
  padding: 8px 10px;
  white-space: nowrap;
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
}
.addr-copy-btn:hover,
.addr-qr-btn:hover {
  border-color: var(--accent);
}
.qr-box {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}
.qr-box img {
  width: 180px;
  height: 180px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
}
.qr-address {
  display: block;
  text-align: center;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  margin-top: 6px;
  word-break: break-all;
}
@media (max-width: 520px) {
  .addr-row {
    grid-template-columns: 1fr;
  }
  .addr-label {
    width: 100%;
  }
  .addr-row button {
    width: 100%;
  }
}
.cancel-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
}
.cancel-btn:hover {
  border-color: var(--accent);
}
.strength-wrap {
  display: grid;
  gap: 6px;
}
.strength-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.strength-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--bad);
  transition: width 0.15s ease;
}
.strength-bar span.good {
  background: var(--good);
}
.strength-bar span.bad {
  background: var(--bad);
}
.muted.good {
  color: var(--good);
}
.muted.bad {
  color: var(--bad);
}
.stat {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-value {
  margin-top: 4px;
  font-size: 16px;
}
.stat-value.positive {
  color: var(--good);
}
.stat-value.negative {
  color: var(--bad);
}
.chart-wrap {
  position: relative;
  height: 340px;
}
#price-chart {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--chart-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  touch-action: pan-y pinch-zoom;
}
.chart-crosshair-vert,
.chart-crosshair-horz,
.chart-crosshair-time,
.chart-crosshair-price {
  position: absolute;
  display: none;
  pointer-events: none;
}
.chart-crosshair-vert {
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(159, 179, 200, 0.5);
}
.chart-crosshair-horz {
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(159, 179, 200, 0.5);
}
.chart-crosshair-time,
.chart-crosshair-price {
  padding: 4px 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}
.chart-crosshair-time {
  bottom: 2px;
}
.chart-crosshair-price {
  right: 2px;
}
.chart-crosshair-vert.show,
.chart-crosshair-horz.show,
.chart-crosshair-time.show,
.chart-crosshair-price.show {
  display: block;
}
#chart-empty {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#chart-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--muted);
  font-size: 14px;
}
#price-chart {
  visibility: hidden;
}
#chart-loading.hidden {
  display: none;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.data-table thead th {
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
}
.price-click,
.amount-click {
  cursor: pointer;
}
.price-click:hover,
.amount-click:hover {
  color: var(--accent);
  text-decoration: underline;
}

.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px;
  font-size: 13px;
  margin: 6px 0;
}
.modal-card .kv > div {
  min-width: 0;
}
.modal-card .kv > div:nth-child(2n) {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.kv code {
  background: var(--input-bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
}
.donate-row {
  display: grid;
  gap: 12px;
  margin: 12px 0;
  align-items: center;
}
.donate-row > * {
  min-width: 0;
}
.donate-row input {
  width: 100%;
  min-width: 140px;
}
 .donate-row button {
  justify-self: end;
}
@media (min-width: 520px) {
  .donate-row {
    grid-template-columns: minmax(150px, 210px) minmax(240px, 1fr) minmax(120px, 160px);
    align-items: center;
  }
}
.donate-meta {
  display: grid;
  grid-template-rows: auto auto;
  gap: 4px;
  align-items: start;
  min-width: 0;
}
.donate-label {
  font-weight: 600;
  letter-spacing: 0.03em;
}
.donate-balance {
  width: auto;
  justify-content: flex-start;
  text-align: left;
  align-self: start;
  font-size: 0.92rem;
}
.admin-card {
  min-height: 240px;
}
.admin-grid {
  display: grid;
  gap: 16px;
  margin-top: 10px;
}
.admin-counts {
  margin-top: 10px;
}
.admin-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
}
.admin-user-block {
  grid-column: 1 / -1;
}
.admin-search {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.admin-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.saved-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.saved-row input {
  flex: 1 1 220px;
  min-width: 160px;
}
.saved-row button {
  width: auto;
  padding: 8px 14px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.faucet-payout-card .faucet-payout-row {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
}
.faucet-payout-card #faucet-payout-grc-save,
.faucet-payout-card #faucet-payout-cure-save {
  min-width: 110px;
}
.faucet-payout-card #faucet-payout-msg {
  margin-top: 8px;
}
@media (max-width: 720px) {
  .donate-meta {
    flex-direction: column;
    align-items: flex-start;
  }
  .donate-balance {
    min-width: 0;
    margin-left: 0;
    text-align: left;
  }
  .faucet-payout-card .faucet-payout-row {
    grid-template-columns: 1fr;
  }
  .faucet-payout-card #faucet-payout-grc-save,
  .faucet-payout-card #faucet-payout-cure-save {
    width: 100%;
  }
}
.admin-suggest {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  max-height: 220px;
  overflow: auto;
}
.admin-suggest.show {
  display: flex;
}
.admin-suggest button {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.admin-suggest button:hover {
  border-color: var(--accent);
}
.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  justify-content: flex-end;
}
.admin-actions .nav-btn {
  width: auto;
  padding: 6px 12px;
}
.small-btn {
  font-size: 0.8rem;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: middle;
}
@media (min-width: 900px) {
  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-user-block {
    grid-column: 1 / -1;
  }
}
.danger {
  background: var(--sell);
  color: #fff;
}
.side-buy {
  color: var(--buy);
  font-weight: 600;
}
.side-sell {
  color: var(--sell);
  font-weight: 600;
}
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 12, 18, 0.7);
  z-index: 60;
}
.modal.show {
  display: flex;
}
.modal-card {
  width: min(420px, 92vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.modal-actions button {
  width: auto;
}
.modal-actions .nav-btn {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
}
.modal-actions #confirm-ok {
  background: var(--btn-bg);
  color: #fff;
  border: none;
}
.ip-modal-card {
  width: min(380px, 92vw);
}
.ip-modal-add {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.ip-modal-add input {
  flex: 1;
  margin: 0;
}
.ip-modal-add button {
  width: auto !important;
  padding: 8px 16px;
  margin: 0;
  flex-shrink: 0;
}
#ip-modal-error {
  min-height: 1.2em;
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.ip-modal-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input-bg);
  margin-bottom: 12px;
}
.ip-modal-list:empty {
  display: none;
}
.ip-modal-list::-webkit-scrollbar {
  width: 6px;
}
.ip-modal-list::-webkit-scrollbar-track {
  background: transparent;
}
.ip-modal-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.ip-modal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.ip-modal-item:last-child {
  border-bottom: none;
}
.ip-modal-item code {
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--text);
}
.ip-modal-item button {
  width: 24px !important;
  height: 24px;
  background: transparent;
  border: 1px solid var(--bad);
  border-radius: 4px;
  color: var(--bad);
  cursor: pointer;
  padding: 0;
  margin: 0;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ip-modal-item button:hover {
  opacity: 1;
  background: var(--bad);
  color: #fff;
}
.ip-modal-2fa-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.ip-modal-2fa-row label {
  font-size: 0.85rem;
  color: var(--muted);
}
.ip-modal-2fa-row input {
  margin: 0;
}
.api-key-2fa-row {
  margin-bottom: 12px;
}
.api-key-2fa-row input {
  margin: 4px 0 0 0;
}
.api-key-edit-ips {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
}
.api-key-edit-ips:hover {
  background: var(--border);
}
.muted {
  color: var(--muted);
}

.txid-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.txid-text code {
  display: block;
  word-break: break-all;
  font-size: 0.85em;
}
.txid-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.txid-actions .tx-copy {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.txid-actions .tx-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9em;
}
.support-reply {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.support-reply input,
.support-reply textarea {
  width: 100%;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}
.support-reply button {
  align-self: flex-start;
}
.ticket-replies {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.reply-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel);
}
.reply-meta {
  font-size: 12px;
  margin-bottom: 4px;
}
.reply-subject {
  font-weight: 600;
  margin-bottom: 6px;
}
.reply-message {
  white-space: pre-wrap;
}
.ticket-latest {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel);
  margin-top: 10px;
}
.ticket-history {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ticket-history-list {
  max-height: 200px;
  overflow: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ticket-history-list::-webkit-scrollbar {
  width: 8px;
}
.ticket-history-list::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 8px;
}
.ticket-history-list::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 8px;
  border: 2px solid var(--scroll-track);
}
.ticket-history-list::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}
.ticket-detail {
  max-height: clamp(260px, 45vh, 520px);
  overflow: auto;
  padding-right: 6px;
}
.ticket-detail::-webkit-scrollbar {
  width: 8px;
}
.ticket-detail::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 8px;
}
.ticket-detail::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 8px;
  border: 2px solid var(--scroll-track);
}
.ticket-detail::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}

/* Scrollbars */
.data-table {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}
.data-table::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}
.data-table::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 8px;
}
.data-table::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 8px;
  border: 2px solid var(--scroll-track);
}
.data-table::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}
@media (max-width: 720px) {
  header {
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    background: transparent;
  }
  .header-box {
    position: relative;
    width: var(--trade-card-width, 100%);
    margin-left: auto;
    margin-right: auto;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: var(--trade-card-width, 100%);
  }
  .brand-link {
    width: 100%;
  }
  .brand-logo {
    height: 36px;
  }
  .menu {
    align-self: flex-end;
  }
  .top-nav {
    width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: 8px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    position: static;
  }
  .header-box .notif-wrapper {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 200;
    margin: 0;
    justify-self: end;
    overflow: visible;
  }
  .header-box .notif-wrapper .notif-bell {
    overflow: visible;
  }
  .top-nav .notif-wrapper {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 200;
    margin: 0;
    justify-self: end;
    overflow: visible;
  }
  .top-nav .notif-wrapper .notif-bell {
    overflow: visible;
  }
  .notif-wrapper .nav-btn {
    width: auto;
    min-width: 34px;
    padding: 6px 8px;
  }
  .top-nav > a,
  .top-nav > .nav-btn {
    width: 100%;
  }
  .top-nav > .nav-btn {
    grid-column: 1 / -1;
  }
  .wallet-status {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
  #chart,
  #trade,
  #trades {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  #chart .card,
  #trade .card,
  #trades .card {
    width: 100%;
    justify-self: stretch;
  }
  body.sync-width .header-box,
  body.sync-width #chart .card {
    width: var(--trade-card-width, 100%);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}

body.is-admin .top-nav {
  flex-wrap: wrap;
  overflow-x: visible;
}
body.is-admin .top-nav::-webkit-scrollbar {
  display: none;
}

/* API Documentation page */
#api-docs {
  grid-template-columns: minmax(280px, 900px);
  justify-content: center;
}
#api-docs .card {
  min-height: auto;
}
#api-docs .code-block {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  margin: 8px 0 16px 0;
}
#api-docs code.code-block {
  white-space: nowrap;
  padding: 8px 12px;
  margin: 4px 0 12px 0;
}
#api-docs pre.code-block {
  white-space: pre;
}
#api-docs .api-list {
  margin: 12px 0;
  padding-left: 24px;
  color: var(--fg);
}
#api-docs .api-list li {
  margin: 8px 0;
  line-height: 1.5;
}
#api-docs .subhead {
  font-size: 1.05rem;
  margin: 20px 0 8px 0;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
#api-docs h2 {
  margin-bottom: 12px;
}

/* API Keys doc link */
.api-docs-link {
  margin: 12px 0 16px 0;
}
.api-docs-link .link-btn {
  margin-top: 0;
}

/* Error text */
.error-text,
#faucet-msg.error-text,
.muted.error-text {
  color: var(--bad) !important;
}

/* Withdraw result banners */
.withdraw-result {
  display: block;
}

.withdraw-email-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, #b8860b 0%, #daa520 100%);
  border: 1px solid #f0c040;
  border-radius: 8px;
  padding: 16px;
  margin: 8px 0;
}
body.theme-light .withdraw-email-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #f59e0b;
}

.withdraw-email-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  color: #fff;
}
body.theme-light .withdraw-email-icon {
  color: #dc2626;
}

.withdraw-email-text {
  flex: 1;
}

.withdraw-email-title {
  font-weight: 600;
  font-size: 1.1em;
  color: #fff;
  margin-bottom: 4px;
}
body.theme-light .withdraw-email-title {
  color: #92400e;
}

.withdraw-email-detail {
  color: #fff;
  font-size: 0.95em;
  line-height: 1.4;
}
body.theme-light .withdraw-email-detail {
  color: #78350f;
}

.withdraw-success-banner {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
  border: 1px solid #10b981;
  border-radius: 8px;
  padding: 16px;
  margin: 8px 0;
}
body.theme-light .withdraw-success-banner {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.withdraw-success-text {
  color: #a7f3d0;
  font-size: 0.95em;
  line-height: 1.4;
}
body.theme-light .withdraw-success-text {
  color: #065f46;
}

.withdraw-error-banner {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
  border: 1px solid #ef4444;
  border-radius: 8px;
  padding: 16px;
  margin: 8px 0;
}
body.theme-light .withdraw-error-banner {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.withdraw-error-text {
  color: #fecaca;
  font-size: 0.95em;
  line-height: 1.4;
}
body.theme-light .withdraw-error-text {
  color: #991b1b;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
  z-index: 999;
}
.back-to-top:hover {
  transform: scale(1.1);
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

