/* SAIKYO Exchange — official fintech style */
:root {
  --bg: #121214;
  --bg-2: #18181b;
  --bg-3: #1f1f23;
  --card: rgba(255,255,255,0.04);
  --card-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --text: #e8e8ec;
  --text-muted: #8f8f96;
  --text-dim: #5c5c64;
  --accent: #16a34a;        /* serious green */
  --accent-2: #22c55e;
  --accent-glow: rgba(34,197,94,.20);
  --blue: #3b82f6;
  --warn: #f59e0b;
  --danger: #ef4444;
  --success: #16a34a;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-lg: 0 20px 60px -20px rgba(0,0,0,.7);
  --shadow-card: 0 1px 0 rgba(255,255,255,.03) inset, 0 6px 18px -6px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
*::before,*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .12s; }
a:hover { color: var(--accent-2); }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 860px; }
.container-tight { max-width: 540px; }

/* ====== HEADER ====== */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,13,20,0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.hdr-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 24px;
}
.logo { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 19px; letter-spacing: -.4px; color: var(--text); }
.logo:hover { color: var(--text); }
.logo-mark {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #16a34a;
  border-radius: 10px;
  font-size: 17px; font-weight: 800; color: #fff;
}
.nav { display: flex; gap: 28px; }
.nav a { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--text); }
.hdr-actions { display: flex; align-items: center; gap: 10px; }
.hdr-status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text-muted);
  padding-right: 14px; border-right: 1px solid var(--border);
}
.hdr-status::before {
  content:''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22,163,74,.4); }
  70% { box-shadow: 0 0 0 8px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}
.hdr-user {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500;
  position: relative;
}
.hdr-user:hover { background: var(--card-hover); }
.hdr-user-ava {
  width: 26px; height: 26px; border-radius: 50%;
  background: #16a34a;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.hdr-user-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 220px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
}
.hdr-user-menu a, .hdr-user-menu button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  font-size: 14px; color: var(--text); text-align: left;
  border-radius: 8px;
}
.hdr-user-menu a:hover, .hdr-user-menu button:hover { background: var(--card-hover); }
.hdr-user-menu hr { margin: 6px 0; }
.hamburger { display: none; }
@media (max-width: 920px) {
  .nav { display: none; }
  .hdr-status { display: none; }
}

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius);
  padding: 11px 18px;
  font-weight: 600; font-size: 14px;
  transition: transform .1s, box-shadow .15s, background .15s, opacity .15s;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn-primary {
  background: #16a34a;
  color: #fff;
  box-shadow: none;
}
.btn-primary:hover { background: #15803d; }
.btn-ghost {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--card-hover); border-color: var(--border-strong); }
.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-outline:hover { background: var(--card); }
.btn-danger {
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.3);
  color: #fca5a5;
}
.btn-danger:hover { background: rgba(239,68,68,.2); }
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  border-radius: 10px;
}

/* ====== UTILITIES ====== */
.grad-text {
  color: var(--accent-2);
}
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.text-success { color: var(--success); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-6{margin-top:24px}.mt-8{margin-top:32px}
.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-6{margin-bottom:24px}.mb-8{margin-bottom:32px}
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 6px;
  font-size: 12px; font-weight: 600;
  background: var(--card); border: 1px solid var(--border);
}
.tag-success { background: rgba(22,163,74,.12); border-color: rgba(22,163,74,.3); color: var(--accent-2); }
.tag-warn { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.3); color: var(--warn); }
.tag-danger { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); color: #fca5a5; }
.tag-info { background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.3); color: #93c5fd; }

/* ====== HERO ====== */
.hero {
  position: relative;
  padding: 56px 0 80px;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: var(--bg-2);
  pointer-events: none;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 480px;
  gap: 48px; align-items: center;
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero { padding: 32px 0 48px; }
}
.hero-left h1 {
  font-size: clamp(32px, 4.4vw, 50px);
  line-height: 1.08;
  margin: 16px 0 18px;
  letter-spacing: -1.1px;
  font-weight: 800;
}
.lead { font-size: 16.5px; color: var(--text-muted); max-width: 560px; }
.badge-hero {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(22,163,74,.10);
  border: 1px solid rgba(22,163,74,.30);
  color: var(--accent-2);
  padding: 6px 12px; border-radius: 99px;
  font-size: 12.5px; font-weight: 600;
}
.badge-hero .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2);
}
.hero-stats {
  display: flex; gap: 36px; margin-top: 32px; flex-wrap: wrap;
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -.4px; }
.hero-stats span { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* ====== EXCHANGE WIDGET ====== */
.exchange {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow-lg);
}
.ex-tabs {
  display: flex; gap: 4px;
  background: rgba(0,0,0,.3);
  border-radius: 11px; padding: 4px;
  margin-bottom: 14px;
}
.ex-tab {
  flex: 1; padding: 10px;
  font-size: 14px; font-weight: 600;
  border-radius: 8px;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.ex-tab.active { background: rgba(255,255,255,.07); color: var(--text); }

.ex-card {
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}
.ex-label {
  display: flex; justify-content: space-between;
  font-size: 12.5px; color: var(--text-muted);
  margin-bottom: 6px;
}
.ex-balance { color: var(--accent-2); font-weight: 500; }
.ex-row { display: flex; align-items: center; gap: 10px; }
.ex-row input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  font-size: 24px; font-weight: 700;
  color: var(--text); letter-spacing: -.4px;
  padding: 4px 0;
}
.ex-row input::placeholder { color: var(--text-dim); }
.ex-coin {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600; font-size: 14px;
  transition: background .15s;
  flex-shrink: 0;
}
.ex-coin:hover { background: var(--card-hover); }
.ex-coin-icon {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #16a34a;
  border-radius: 50%;
  font-size: 13px; font-weight: 700; color: #fff;
}
.ex-network { margin-top: 10px; }
.ex-network-label { font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 6px; }
.ex-networks { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-net {
  padding: 6px 11px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
  transition: background .15s, color .15s, border-color .15s;
}
.ex-net:hover { background: var(--card-hover); color: var(--text); }
.ex-net.active {
  background: rgba(22,163,74,.18);
  color: var(--accent-2);
  border-color: rgba(22,163,74,.45);
}
.ex-swap {
  display: block;
  margin: -8px auto;
  width: 38px; height: 38px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 50%;
  position: relative; z-index: 2;
  color: var(--text-muted);
  transition: transform .25s, color .15s;
}
.ex-swap:hover { color: var(--text); transform: rotate(180deg); }
.ex-swap svg { display: block; margin: 0 auto; }
.ex-rate {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(0,0,0,.3);
  border-radius: 12px;
  font-size: 13px;
}
.ex-rate-row {
  display: flex; justify-content: space-between;
  padding: 4px 0;
}
.ex-rate-row:not(:last-child) { border-bottom: 1px dashed rgba(255,255,255,.05); }
.ex-rate-row span:first-child { color: var(--text-muted); }
.ex-rate-row span:last-child { color: var(--text); font-weight: 500; }
.ex-rate-row.small { font-size: 11px; }
.ex-rate-row.small span { color: var(--text-dim) !important; font-weight: 400; }
.ex-reserve {
  margin-top: 8px; padding: 8px 12px;
  background: rgba(22,163,74,.07);
  border: 1px solid rgba(22,163,74,.2);
  border-radius: 10px;
  font-size: 12.5px;
  display: flex; justify-content: space-between;
}
.ex-reserve span:first-child { color: var(--text-muted); }
.ex-reserve span:last-child { color: var(--accent-2); font-weight: 600; }
#create-order { margin-top: 14px; }
.legal-badge {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(59,130,246,.10);
  border: 1px solid rgba(96,165,250,.35);
  color: #bfdbfe;
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
}
.ex-foot {
  text-align: center; font-size: 12px; color: var(--text-muted);
  margin-top: 12px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  flex-wrap: wrap;
}

/* ====== SECTIONS ====== */
.section { padding: 72px 0; }
.section-alt { background: rgba(255,255,255,.018); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title {
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 800;
  letter-spacing: -.8px;
  text-align: center;
  margin: 0 0 14px;
}
.section-sub {
  text-align: center; color: var(--text-muted);
  max-width: 620px; margin: 0 auto 44px;
  font-size: 15px;
}

/* ====== ADVANTAGES ====== */
.adv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 880px) { .adv-grid { grid-template-columns: 1fr; } }
.adv {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform .2s, border-color .2s;
}
.adv:hover { transform: translateY(-3px); border-color: rgba(22,163,74,.3); }
.adv-ico {
  width: 44px; height: 44px;
  background: rgba(22,163,74,.12);
  border: 1px solid rgba(22,163,74,.28);
  border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  color: var(--accent-2);
}
.adv h3 { font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.adv p { color: var(--text-muted); font-size: 14px; margin: 0; }

/* ====== HOW ====== */
.how-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 980px) { .how-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .how-grid { grid-template-columns: 1fr; } }
.how-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.how-num {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #16a34a;
  border-radius: 10px;
  font-weight: 800; color: #fff; font-size: 15px;
  margin-bottom: 14px;
}
.how-card h3 { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.how-card p { color: var(--text-muted); font-size: 13.5px; margin: 0; }

/* ====== REVIEWS ====== */
.rev-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 980px) { .rev-grid { grid-template-columns: 1fr; } }
.rev {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.rev-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rev-ava {
  width: 40px; height: 40px;
  background: #16a34a;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 15px;
}
.rev-head b { display: block; font-size: 14px; }
.rev-head span { font-size: 12px; color: var(--text-muted); }
.rev-stars { margin-left: auto; color: #facc15; font-size: 13px; letter-spacing: 1px; }
.rev p { color: #cfd2dc; font-size: 14px; margin: 0; }
.rev-reply {
  margin-top: 12px; padding: 10px 12px;
  background: rgba(22,163,74,.07);
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 13px;
}
.rev-reply b { color: var(--accent-2); font-size: 12.5px; display: block; margin-bottom: 2px; }
.rev-reply p { color: var(--text-muted); margin: 0; font-size: 13px; }

/* ====== FAQ ====== */
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq summary {
  padding: 16px 50px 16px 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  font-size: 14.5px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 22px; color: var(--text-muted);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq p { padding: 0 20px 18px; margin: 0; color: var(--text-muted); font-size: 14px; }

/* ====== FOOTER ====== */
.footer {
  background: #0c0c0e;
  border-top: 1px solid var(--border);
  padding: 56px 0 24px;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-desc { color: var(--text-muted); font-size: 13.5px; margin: 12px 0 0; max-width: 360px; }
.footer h4 { font-size: 13px; margin: 0 0 14px; color: var(--text); text-transform: uppercase; letter-spacing: .5px; }
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li { color: var(--text-muted); font-size: 13.5px; padding: 4px 0; }
.footer-list a { color: var(--text-muted); transition: color .15s; }
.footer-list a:hover { color: var(--text); }
.footer-bot {
  padding-top: 22px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.footer-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-badge {
  padding: 4px 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ====== MODALS ====== */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 460px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  animation: slideUp .25s ease;
  overflow-y: auto;
}
.modal-card-wide { max-width: 540px; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; flex-shrink: 0;
}
.modal-head h3 { margin: 0; font-size: 19px; }
.modal-close {
  width: 36px; height: 36px;
  font-size: 22px; line-height: 1;
  border-radius: 10px;
  background: var(--card); color: var(--text-muted);
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--card-hover); color: var(--text); }

/* ====== COIN PICKER ====== */
.coin-search {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text); outline: none;
  margin-bottom: 12px;
}
.coin-search:focus { border-color: rgba(22,163,74,.5); }
.coin-list {
  overflow-y: auto; flex: 1;
  margin: 0 -8px; padding: 0 8px;
}
.coin-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
  transition: background .12s;
}
.coin-item:hover { background: var(--card-hover); }
.coin-item-icon {
  width: 34px; height: 34px;
  background: #16a34a;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
}
.coin-item-name { flex: 1; }
.coin-item-name b { display: block; font-size: 14px; }
.coin-item-name span { font-size: 12px; color: var(--text-muted); }
.coin-item-price { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ====== FORMS ====== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .field > .field-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.field em { color: #ef4444; font-style: normal; }
.field input, .field select, .field textarea {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text); outline: none;
  transition: border-color .15s;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(22,163,74,.5); }
.field-hint { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.field-error { font-size: 12.5px; color: #fca5a5; margin-top: 2px; }
.field-check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--text-muted);
}
.field-check input { margin-top: 2px; width: auto; }
.field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 540px) { .field-grid-2 { grid-template-columns: 1fr; } }

/* ====== TOAST ====== */
.toast-stack {
  position: fixed; bottom: 22px; right: 22px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 999;
  max-width: 360px;
}
.toast {
  padding: 13px 16px; border-radius: 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  display: flex; align-items: flex-start; gap: 10px;
  animation: slideIn .25s;
}
.toast.toast-success { border-color: rgba(22,163,74,.4); }
.toast.toast-error { border-color: rgba(239,68,68,.4); }
.toast.toast-info { border-color: rgba(59,130,246,.4); }
.toast-ico { font-size: 18px; flex-shrink: 0; }
.toast-success .toast-ico { color: var(--accent-2); }
.toast-error .toast-ico { color: #fca5a5; }
.toast-info .toast-ico { color: #93c5fd; }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ====== AUTH PAGES ====== */
.auth-wrap {
  min-height: calc(100vh - 68px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  background: var(--bg-2);
}
.auth-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.5px; }
.auth-card .auth-sub { color: var(--text-muted); margin: 0 0 24px; font-size: 14px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--text-muted); }
.auth-card-wide { max-width: 620px; }
.acc-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 22px; }
.acc-switch-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; text-align: left;
  color: var(--text); font-family: inherit;
  transition: all .15s;
}
.acc-switch-btn:hover { border-color: rgba(22,163,74,.35); }
.acc-switch-btn.active { border-color: var(--accent); background: rgba(22,163,74,.08); box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.acc-switch-btn > div { display: flex; flex-direction: column; gap: 2px; }
.acc-switch-btn b { font-size: 14px; }
.acc-switch-btn span:last-child { font-size: 11.5px; color: var(--text-muted); }
.acc-switch-ico { font-size: 24px; width: 40px; text-align: center; }
.legal-block-title { font-weight: 700; font-size: 13px; color: var(--accent-2); letter-spacing: .5px; text-transform: uppercase; margin: 20px 0 12px; padding-top: 16px; border-top: 1px dashed var(--border); }
.radio-row { display: flex; gap: 18px; padding: 10px 0 2px; }
.radio-row label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.legal-notice {
  margin-top: 14px; padding: 12px 14px;
  background: rgba(59,130,246,.08);
  border: 1px solid rgba(59,130,246,.28);
  border-radius: 10px;
  color: #bfdbfe; font-size: 12.5px; line-height: 1.55;
}
@media (max-width: 640px) {
  .acc-switch { grid-template-columns: 1fr; }
}

/* ====== PAGE LAYOUT (account, admin) ====== */
.page {
  padding: 36px 0 80px;
  min-height: calc(100vh - 68px);
}
.page h1 { font-size: 28px; letter-spacing: -.5px; margin: 0 0 8px; }
.page-sub { color: var(--text-muted); margin: 0 0 28px; }

/* sidebar layout */
.sidebar-layout {
  display: grid; grid-template-columns: 240px 1fr; gap: 28px;
}
@media (max-width: 880px) { .sidebar-layout { grid-template-columns: 1fr; } }
.side {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px;
  height: fit-content;
  position: sticky; top: 84px;
}
@media (max-width: 880px) { .side { position: static; } }
.side a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 9px;
  font-size: 14px; color: var(--text-muted); font-weight: 500;
}
.side a:hover { background: var(--card-hover); color: var(--text); }
.side a.active { background: rgba(22,163,74,.12); color: var(--accent-2); }
.side-divider { height: 1px; background: var(--border); margin: 8px 4px; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); padding: 8px 12px 4px; }

/* ====== CARD ====== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-head h2 { font-size: 18px; margin: 0; font-weight: 700; }

/* ====== TABLES ====== */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th {
  text-align: left; padding: 10px 12px;
  background: rgba(255,255,255,.025);
  font-weight: 600; color: var(--text-muted);
  font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  border-bottom: 1px solid var(--border);
}
.table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.table tbody tr:hover { background: rgba(255,255,255,.02); }
.table tbody tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; margin: 0 -12px; }
.table-wrap table { min-width: 600px; }

/* ====== PROGRESS / STEPS ====== */
.steps {
  display: flex; gap: 8px;
  margin: 16px 0 22px;
}
.step {
  flex: 1;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-dim);
  position: relative;
}
.step.done { border-color: rgba(22,163,74,.4); background: rgba(22,163,74,.08); color: var(--accent-2); }
.step.active { border-color: var(--accent); background: rgba(22,163,74,.12); color: var(--text); }
.step b { display: block; font-size: 13px; color: inherit; margin-bottom: 2px; }

/* ====== STATS ====== */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 880px) { .stats-grid { grid-template-columns: 1fr 1fr; } }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.stat-card .stat-val { font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.stat-card .stat-delta { font-size: 12px; margin-top: 4px; }
.stat-card .stat-delta.up { color: var(--success); }
.stat-card .stat-delta.down { color: var(--danger); }

/* ====== KYC ====== */
.kyc-stage {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  margin-bottom: 14px;
}
.kyc-stage-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
}
.kyc-stage-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--card-hover);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--text-muted);
  font-size: 14px;
}
.kyc-stage.done .kyc-stage-num { background: var(--accent); color: #fff; }
.kyc-stage.active .kyc-stage-num { background: rgba(22,163,74,.15); color: var(--accent-2); border: 2px solid var(--accent); }
.kyc-stage h3 { margin: 0; font-size: 16px; flex: 1; }
.kyc-upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  font-size: 13.5px; color: var(--text-muted);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.kyc-upload-zone:hover { border-color: var(--accent); background: rgba(22,163,74,.05); }
.kyc-upload-zone.has-file { border-color: var(--accent); background: rgba(22,163,74,.07); color: var(--accent-2); }

/* ====== CHAT WIDGET ====== */
.chat-fab {
  position: fixed; bottom: 22px; right: 22px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 90;
  box-shadow: 0 10px 28px -6px var(--accent-glow), 0 4px 14px rgba(0,0,0,.4);
  transition: transform .15s, box-shadow .15s;
}
.chat-fab:hover { transform: scale(1.06); }
.chat-fab .badge-num {
  position: absolute; top: -4px; right: -4px;
  min-width: 22px; height: 22px;
  background: #ef4444; color: #fff;
  border: 2px solid var(--bg);
  border-radius: 11px;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px;
}
.chat-window {
  position: fixed;
  bottom: 92px; right: 22px;
  width: 380px;
  max-width: calc(100vw - 44px);
  height: 560px;
  max-height: calc(100vh - 130px);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  z-index: 91;
  overflow: hidden;
  animation: slideUp .25s;
}
.chat-window[hidden] { display: none; }
.chat-header {
  padding: 14px 16px;
  background: #16a34a;
  color: #fff;
  display: flex; align-items: center; gap: 12px;
}
.chat-header-ava {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  position: relative;
}
.chat-header-ava::after {
  content: ''; position: absolute; bottom: 0; right: 0;
  width: 11px; height: 11px; border-radius: 50%;
  background: #22c55e;
  border: 2px solid #16a34a;
}
.chat-header-info { flex: 1; }
.chat-header-info b { display: block; font-size: 14.5px; }
.chat-header-info span { font-size: 12px; opacity: .85; }
.chat-header-close {
  background: rgba(255,255,255,.15);
  width: 32px; height: 32px; border-radius: 8px;
  color: #fff; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
}
.chat-header-close:hover { background: rgba(255,255,255,.25); }
.chat-body {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg);
}
.chat-msg { display: flex; flex-direction: column; max-width: 78%; }
.chat-msg.me { align-self: flex-end; align-items: flex-end; }
.chat-msg.them { align-self: flex-start; }
.chat-msg-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px; line-height: 1.4;
  word-break: break-word;
}
.chat-msg.me .chat-msg-bubble {
  background: #16a34a;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.them .chat-msg-bubble {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-msg.system .chat-msg-bubble {
  background: rgba(59,130,246,.1);
  border: 1px solid rgba(59,130,246,.25);
  color: #93c5fd;
  font-size: 13px;
}
.chat-msg.system { align-self: center; max-width: 90%; }
.chat-msg-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
  padding: 0 4px;
}
.chat-typing {
  display: inline-flex; gap: 4px;
  padding: 10px 14px;
  background: var(--bg-3);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.chat-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted);
  animation: typing 1.4s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
.chat-input-wrap {
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  display: flex; gap: 8px; align-items: flex-end;
}
.chat-input {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 13px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  resize: none;
  max-height: 100px;
  min-height: 38px;
  font-family: inherit;
}
.chat-input:focus { border-color: rgba(22,163,74,.45); }
.chat-send {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: #16a34a;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-send:hover { box-shadow: 0 4px 14px -2px var(--accent-glow); }
.chat-attach {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-attach:hover { color: var(--text); background: var(--card-hover); }
.chat-quick {
  padding: 0 12px 8px;
  display: flex; gap: 6px; flex-wrap: wrap;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}
.chat-quick button {
  padding: 5px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 12px; color: var(--text-muted);
}
.chat-quick button:hover { background: var(--card-hover); color: var(--text); }

/* full chat page */
.chat-page {
  display: grid; grid-template-columns: 280px 1fr; gap: 18px;
  height: calc(100vh - 68px - 36px);
}
@media (max-width: 880px) { .chat-page { grid-template-columns: 1fr; } }
.chat-list {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-y: auto;
}
.chat-list-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; align-items: center;
  cursor: pointer; transition: background .12s;
}
.chat-list-item:hover, .chat-list-item.active { background: var(--card-hover); }
.chat-list-item-ava {
  width: 38px; height: 38px; border-radius: 50%;
  background: #2563eb;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 14px;
  flex-shrink: 0;
}
.chat-list-item-info { flex: 1; min-width: 0; }
.chat-list-item-info b { display: block; font-size: 14px; }
.chat-list-item-info span { display: block; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-item-time { font-size: 11px; color: var(--text-dim); }

/* hide chat fab on chat/admin pages if needed */
body.no-chat-fab .chat-fab, body.no-chat-fab .chat-window { display: none !important; }

/* ====== TARIFF SWITCHER ====== */
.ex-tariff {
  margin: 14px 0 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.ex-tariff-label {
  display: block;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.ex-tariff-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.ex-tariff-tab {
  padding: 9px 8px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 9px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ex-tariff-tab:hover:not(:disabled) {
  background: rgba(22,163,74,.08);
  border-color: rgba(22,163,74,.3);
  color: var(--text);
}
.ex-tariff-tab.active {
  background: rgba(22,163,74,.20);
  border-color: rgba(22,163,74,.55);
  color: #fff;
}
.ex-tariff-tab:disabled { cursor: not-allowed; }
@media (max-width: 540px) {
  .ex-tariff-tabs { grid-template-columns: 1fr; }
  .ex-tariff-tab { padding: 10px 12px; font-size: 13px; }
}

/* ====== ORDER SUMMARY ROWS ====== */
.sum-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 6px 0;
  font-size: 13.5px;
}
.sum-row:not(:last-child) { border-bottom: 1px dashed rgba(255,255,255,.06); }
.sum-row span:first-child { color: var(--text-muted); }
.sum-row span:last-child  { color: var(--text); font-weight: 500; text-align: right; }

/* ====== CRYPTO ICONS (cryptocurrency-icons CDN) ====== */
.ex-coin-icon img,
.coin-item-icon img {
  display: block;
  border-radius: 50%;
  background: transparent;
}
.ex-coin-icon {
  background: transparent !important;
  padding: 0;
  overflow: hidden;
}
.ex-coin-icon.is-fiat {
  background: #16a34a !important;
  color: #fff;
  font-weight: 800;
}
.coin-item-icon {
  background: transparent !important;
  width: 36px; height: 36px;
}
.ex-coin-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: #16a34a;
  border-radius: 50%;
  color: #fff; font-weight: 800; font-size: 11px;
}

/* ====== COOKIE BANNER ====== */
.cookie-banner {
  position: fixed;
  left: 22px; right: 22px; bottom: 22px;
  z-index: 95;
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-lg);
  max-width: 920px;
  margin-left: auto; margin-right: auto;
  animation: slideUp .3s ease;
  font-size: 13.5px;
}
.cookie-banner-text { flex: 1; color: var(--text-muted); line-height: 1.5; }
.cookie-banner-text a { color: var(--accent-2); }
.cookie-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 640px) {
  .cookie-banner { left: 10px; right: 10px; bottom: 10px; padding: 12px 14px; flex-direction: column; align-items: stretch; }
  .cookie-banner-actions { justify-content: flex-end; }
  .chat-fab { width: 50px; height: 50px; bottom: 80px; }
  .chat-window { bottom: 138px; height: calc(100vh - 200px); }
}

/* ====== MOBILE ADAPT (общие правки) ====== */
@media (max-width: 640px) {
  .container { padding: 0 14px; }
  .hdr-row { height: 56px; gap: 10px; }
  .logo { font-size: 16px; }
  .logo-mark { width: 30px; height: 30px; font-size: 14px; }
  .hdr-actions .btn { padding: 7px 11px; font-size: 12.5px; }
  .hdr-user span:not(.hdr-user-ava) { display: none; }
  .hero { padding: 24px 0 36px; }
  .hero-left h1 { font-size: 28px; }
  .lead { font-size: 14.5px; }
  .hero-stats { gap: 18px; margin-top: 18px; }
  .hero-stats b { font-size: 22px; }
  .exchange { padding: 16px; border-radius: 16px; }
  .ex-row input { font-size: 20px; }
  .section { padding: 44px 0; }
  .section-title { font-size: 24px; }
  .section-sub { font-size: 14px; margin-bottom: 26px; }
  .modal { padding: 12px; }
  .modal-card { padding: 16px; border-radius: 16px; }
  .footer { padding: 36px 0 18px; margin-top: 36px; }
  .footer-grid { gap: 22px; padding-bottom: 22px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .stat-val { font-size: 20px; }
  .field input, .field select, .field textarea { font-size: 16px; } /* предотвращает зум на iOS */
  .auth-card { padding: 22px 18px; border-radius: 14px; }
  .auth-card h1 { font-size: 22px; }
  .acc-switch-btn { padding: 12px; }
  .acc-switch-btn b { font-size: 13px; }
  .acc-switch-btn span:last-child { font-size: 11px; }
  .page { padding: 22px 0 60px; }
  .page h1 { font-size: 22px; }
  .table-wrap { margin: 0 -14px; }
  .table-wrap table { font-size: 12.5px; }
  .ex-tab { padding: 8px; font-size: 13px; }
  .toast-stack { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .steps { gap: 5px; }
  .step { padding: 8px; font-size: 11px; }
  .ex-tariff-tabs { grid-template-columns: 1fr 1fr; }
  .ex-tariff-tab { padding: 8px; font-size: 12px; }
  .footer-grid { grid-template-columns: 1fr; }
  .sidebar-layout { grid-template-columns: 1fr; }
  .chat-window { width: 100%; max-width: calc(100vw - 24px); right: 12px; bottom: 12px; height: calc(100vh - 120px); }
  .chat-fab { width: 48px; height: 48px; bottom: 12px; right: 12px; }
}

@media (max-width: 380px) {
  .ex-tariff-tabs { grid-template-columns: 1fr; }
  .ex-tab { font-size: 12px; padding: 6px; }
  .hero-left h1 { font-size: 24px; }
  .exchange { padding: 12px; border-radius: 12px; }
  .ex-row input { font-size: 18px; }
}
