.btn {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  min-height: 34px;
  padding: 8px 13px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { border-color: #3d4654; transform: translateY(-1px); }
.btn-primary { background: var(--brand-gradient); border-color: var(--brand-primary); color: #fff; font-weight: 800; box-shadow: var(--glow-sm); transition: box-shadow .2s, transform .15s; }
.btn-primary:hover { background: var(--brand-primary-hover); border-color: var(--brand-primary-hover); }
.btn-primary:hover { box-shadow: var(--glow-md); transform: translateY(-1px); }
.btn-buy { background: linear-gradient(135deg, #00c853, #00e676); border-color: var(--color-buy); color: #04150e; font-weight: 800; }
.btn-sell, .btn-danger { background: linear-gradient(135deg, #d50000, #ff1744); border-color: var(--color-sell); color: #fff; font-weight: 800; }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 28px; padding: 5px 9px; font-size: 12px; }
.text-btn { background: transparent; border: 0; padding: 0; color: var(--brand-primary); }
.ripple:after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  background: rgba(255,255,255,.45);
  display: block;
  border-radius: 50%;
  opacity: 0;
  transform: scale(1);
  left: var(--rx, 50%);
  top: var(--ry, 50%);
}
.ripple.rippling:after { animation: ripple .45s ease-out; }
@keyframes ripple { from { opacity: .55; transform: scale(1); } to { opacity: 0; transform: scale(28); } }

.glass-panel {
  background: rgba(19,23,34,.76);
  border: 1px solid rgba(132,142,156,.2);
  backdrop-filter: blur(16px);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.demo-banner, .admin-badge { display: inline-flex; padding: 4px 8px; background: var(--brand-gradient); border: 1px solid var(--border-blue); color: #fff; border-radius: 4px; font-size: 11px; font-weight: 800; box-shadow: var(--glow-sm); }
.toast-root { position: fixed; top: 74px; right: 18px; z-index: 100; display: grid; gap: 10px; }
.toast { min-width: 260px; border: 1px solid var(--border-primary); background: rgba(19,23,34,.96); padding: 12px 14px; border-radius: 6px; box-shadow: var(--shadow); animation: slideToast .25s ease; }
.toast.success { border-left: 3px solid var(--color-buy); }
.toast.danger { border-left: 3px solid var(--color-sell); }
@keyframes slideToast { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.64); display: grid; place-items: center; padding: 20px; }
.modal { width: min(680px, 100%); max-height: 88vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 15px 16px; border-bottom: 1px solid var(--border-secondary); }
.modal-body { padding: 16px; }
.close-x { border: 0; background: transparent; color: var(--text-secondary); font-size: 22px; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; border: 1px solid var(--border-primary); padding: 3px 8px; font-size: 11px; color: var(--text-secondary); }
.pill.green { color: var(--color-buy); border-color: rgba(14,203,129,.35); background: rgba(14,203,129,.08); }
.pill.red { color: var(--color-sell); border-color: rgba(246,70,93,.35); background: rgba(246,70,93,.08); }
.pill.yellow { color: var(--status-warning); border-color: rgba(255,159,0,.35); background: rgba(255,159,0,.08); }
.flash-up { animation: flashUp .3s ease; }
.flash-down { animation: flashDown .3s ease; }
@keyframes flashUp { 0% { background: rgba(14,203,129,.26); } 100% { background: transparent; } }
@keyframes flashDown { 0% { background: rgba(246,70,93,.26); } 100% { background: transparent; } }
.skeleton { position: relative; overflow: hidden; background: var(--bg-tertiary); border-radius: 4px; min-height: 18px; }
.skeleton:after { content:""; position:absolute; inset:0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); animation: shimmer 1.1s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.switch { display: inline-flex; width: 44px; height: 24px; border-radius: 999px; padding: 3px; background: var(--bg-tertiary); border: 1px solid var(--border-primary); vertical-align: middle; }
.switch:before { content:""; width: 16px; height: 16px; border-radius: 50%; background: var(--text-tertiary); transition: transform .18s, background .18s; }
.switch.on:before { transform: translateX(18px); background: var(--brand-primary); }
.qr { width: 144px; height: 144px; background: repeating-linear-gradient(45deg,#fff 0 7px,#111 7px 14px); border: 8px solid #fff; }
.checkbox-row { display: flex; grid-template-columns: none; align-items: center; gap: 10px; }
.checkbox-row input { width: auto; min-height: auto; }
.message-layout { display: grid; grid-template-columns: 280px 1fr; min-height: 520px; }
.message-list { border-right: 1px solid var(--border-secondary); overflow: auto; }
.message-item { width: 100%; display: grid; gap: 5px; text-align: left; padding: 14px; background: transparent; color: var(--text-secondary); border: 0; border-bottom: 1px solid var(--border-secondary); }
.message-item.active, .message-item:hover { background: var(--brand-primary-glow); color: var(--text-primary); }
.message-detail { padding: 24px; }
.message-detail hr { border: 0; border-top: 1px solid var(--border-secondary); margin: 18px 0; }
@media (max-width: 767px) { .message-layout { grid-template-columns: 1fr; } .message-list { border-right: 0; max-height: 260px; } }
