/* ============================================
   RoyalFX — Design System & Components
   ============================================ */

/* === Google Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,400..700,0..1,0&display=swap');

/* === Material Symbols icon system (replaces all emojis) === */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded', sans-serif;
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
.mi {
  font-family: 'Material Symbols Rounded', sans-serif;
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  user-select: none;
  vertical-align: middle;
  font-size: 1.15em;
}
.mi.mi-18 { font-size: 18px; }
.mi.mi-20 { font-size: 20px; }
.mi.mi-24 { font-size: 24px; }
.mi.mi-32 { font-size: 32px; }
.mi.mi-48 { font-size: 48px; }
.mi.mi-64 { font-size: 64px; }
.nav-icon.mi, .market-icon .mi, .tx-icon .mi, .empty-icon .mi,
.modal-title .mi, .card-title .mi,
button .mi, .btn .mi { font-size: inherit; }
.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.market-icon .mi { font-size: 22px; }
.nav-icon.mi { font-size: 22px; }
button .mi, .btn .mi, .btn-action .mi { font-size: 18px; margin-right: 2px; }
.card-title .mi, .modal-title .mi, .section-title .mi, h1 .mi, h2 .mi, h3 .mi { margin-right: 6px; }

/* Ensure material symbol icons are always visible */
.mi { color: #FFFFFF !important; }
.bottom-nav a.active .mi { color: var(--accent) !important; }
.um-link.active > .mi { color: var(--accent) !important; }


/* === CSS Variables ===
   Royalx design tokens — royal purple / gold theme.
   NOTE: every var() referenced in this file MUST be declared here,
   otherwise the property silently falls back to nothing. */
:root {
  /* --- Surfaces --- */
  --primary: #0B0616;
  /* deep royal purple-black page background */
  --primary-light: #150D26;
  /* raised surfaces, chips */
  --primary-dark: #000000;
  /* deepest shade + text on accent */

  /* --- Brand accents --- */
  --accent: #F5C542;
  /* royal gold — primary brand colour */
  --accent-2: #D4A017;
  /* gradient partner (darker gold) */
  --accent-dark: #B8860B;
  /* accent hover / pressed */
  --accent-soft: rgba(245, 197, 66, 0.1);
  --accent-glow: rgba(245, 197, 66, 0.28);
  --brand-gradient: linear-gradient(159deg, #0B0616 0%, #4C1D95 100%);
  --amber: #F5C542;
  --amber-2: #D4A017;
  --magenta: #9333EA;
  --magenta-2: #581C87;

  /* --- Status --- */
  --danger: #FF4D4D;
  --success: #22c55e;
  --warning: #F5C542;
  --info: #C084FC;

  /* --- Text --- */
  --white: #FFFFFF;
  --text: #EFE6FB;
  --gray: #A79BC4;
  --gray-200: #C4B5A0;
  --gray-300: #B09E88;
  --gray-400: #9A8670;
  --gray-500: #7A6B58;
  --gray-600: #5C4F3F;
  --gray-dark: #3b2e24;

  /* --- Glass, borders --- */
  --glass: rgba(0, 0, 0, 0.75);
  --glass-light: rgba(255, 255, 255, 0.055);
  --glass-border: rgba(168, 85, 247, 0.16);
  --border: rgba(168, 85, 247, 0.16);

  /* --- Radii --- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* --- Motion & shadow --- */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 0 24px rgba(245, 197, 66, 0.25);
  --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, 0.85);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --bottom-nav-height: 72px;
}

/* === Reset & Base === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--primary);
  color: var(--white);
  font-family: var(--font);
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
}

img {
  max-width: 100%;
  height: auto;
}

button {
  cursor: pointer;
  font-family: var(--font);
}

input,
select,
textarea {
  font-family: var(--font);
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--primary-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-600);
  border-radius: var(--radius-full);
}

/* === Page Wrapper === */
.page-wrapper {
  min-height: 100vh;
  padding-top: 64px;
  padding-bottom: calc(var(--bottom-nav-height) + 16px);
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.page-content {
  padding: 16px;
  max-width: 480px;
  margin: 0 auto;
}

/* === Top Header === */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-header .logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-header .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--brand-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  color: #FFFFFF;
}

/* Two-tone brand name (header + drawer) */
.brand-name {
  display: inline-block;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.1;
  white-space: nowrap;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

  .brand-name span {
  background: linear-gradient(135deg, #FFFFFF 0%, #D7CCF0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.header-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: var(--glass-light);
  border-radius: var(--radius-sm);
  color: var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  font-size: 18px;
}

.header-btn:hover {
  background: var(--accent);
  color: #FFFFFF;
}

/* === Bottom Navigation === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--gray-400);
  font-size: 10px;
  font-weight: 500;
  transition: var(--transition-fast);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  position: relative;
}

.bottom-nav a .nav-icon {
  font-size: 22px;
  transition: var(--transition-fast);
}

.bottom-nav a.active {
  color: var(--accent);
}

.bottom-nav a.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 var(--radius-full) var(--radius-full);
}

.bottom-nav a.trade-btn {
  margin-top: -20px;
}

.bottom-nav a.trade-btn .nav-icon {
  width: 48px;
  height: 48px;
  background: var(--brand-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 24px;
  box-shadow: var(--shadow-glow);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
  cursor: pointer;
  width: 100%;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: var(--brand-gradient);
  color: #FFFFFF;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px var(--accent-glow);
  color: #FFFFFF;
}

.btn-secondary {
  background: var(--glass-light);
  color: var(--white);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #ff6b6b);
  color: var(--white);
}

.btn-buy {
  background: var(--brand-gradient);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 16px;
  padding: 14px;
}

.btn-sell {
  background: linear-gradient(135deg, var(--danger), #ff6b6b);
  color: var(--white);
  font-weight: 700;
  font-size: 16px;
  padding: 14px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #FFFFFF;
}

/* === Cards === */
.card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.card-sm {
  padding: 14px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === Balance Display === */
.balance-card {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
}

.balance-label {
  font-size: 12px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.balance-amount {
  font-size: 32px;
  font-weight: 800;
  color: var(--white);
  position: relative;
}

.balance-amount .currency {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-400);
}

.balance-row {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  gap: 12px;
}

.balance-item {
  flex: 1;
  text-align: center;
  padding: 10px;
  background: var(--glass-light);
  border-radius: var(--radius-md);
}

.balance-item-label {
  font-size: 10px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.balance-item-value {
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
}

.text-profit {
  color: var(--success);
}

.text-loss {
  color: var(--danger);
}

.text-accent {
  color: var(--accent);
}

.text-neutral {
  color: var(--gray-300);
}

/* === Form Inputs === */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: 16px;
  transition: var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--gray-500);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* === Trading Panel === */
.trade-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.pair-selector {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.pair-selector::-webkit-scrollbar {
  display: none;
}

.pair-chip {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--gray-300);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.pair-chip:hover,
.pair-chip.active {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}

/* === Trade List === */
.trade-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--glass-light);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  border: 1px solid var(--glass-border);
  transition: var(--transition-fast);
}

.trade-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.trade-item-pair {
  font-weight: 700;
  font-size: 14px;
}

.trade-item-info {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
}

.trade-item-pl {
  font-weight: 700;
  font-size: 14px;
  text-align: right;
}

.trade-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.trade-type.buy {
  background: rgba(0, 200, 83, 0.15);
  color: var(--success);
}

.trade-type.sell {
  background: rgba(255, 61, 87, 0.15);
  color: var(--danger);
}

/* === Market List === */
.market-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: var(--transition-fast);
}

.market-item:hover {
  background: var(--glass-light);
  margin: 0 -16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
}

.market-item:last-child {
  border-bottom: none;
}

.market-pair {
  display: flex;
  align-items: center;
  gap: 12px;
}

.market-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #FFFFFF;
  flex-shrink: 0;
}
.market-icon .mi {
  font-size: 22px !important;
  color: #FFFFFF !important;
  line-height: 1;
}
/* Plain flag/emoji icons (no circle) — used on Markets list */
.market-emoji {
  background: none !important;
  border: none !important;
  font-size: 26px;
  line-height: 1;
}

.market-name {
  font-weight: 700;
  font-size: 14px;
}

.market-fullname {
  font-size: 11px;
  color: var(--gray-400);
}

.market-price {
  text-align: right;
}

.market-price-value {
  font-weight: 700;
  font-size: 14px;
}

.market-change {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-top: 2px;
}

.market-change.up {
  background: rgba(0, 200, 83, 0.15);
  color: var(--success);
}

.market-change.down {
  background: rgba(255, 61, 87, 0.15);
  color: var(--danger);
}

/* === Transaction List === */
.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--glass-border);
}

.tx-item:last-child {
  border-bottom: none;
}

.tx-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  margin-right: 12px;
}

.tx-icon.deposit {
  background: rgba(0, 200, 83, 0.15);
  color: var(--success);
}

.tx-icon.withdraw {
  background: rgba(255, 61, 87, 0.15);
  color: var(--danger);
}

.tx-details {
  flex: 1;
}

.tx-type {
  font-weight: 600;
  font-size: 14px;
}

.tx-date {
  font-size: 11px;
  color: var(--gray-400);
}

.tx-amount {
  font-weight: 700;
  font-size: 14px;
  text-align: right;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 32px 24px;
  width: 100%;
  max-width: 480px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--gray-600);
  border-radius: var(--radius-full);
  margin: 0 auto 20px;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
}

.modal-text {
  text-align: center;
  color: var(--gray-400);
  font-size: 14px;
  margin-bottom: 24px;
}

/* === Components === */
.stats-header {
  display: flex;
  gap: 20px;
  padding: 12px 16px;
  background: var(--primary);
}

.stat-group {
  flex: 1;
}

.stat-label {
  font-size: 10px;
  color: var(--gray);
  text-transform: uppercase;
  font-weight: 600;
}

.stat-value {
  font-size: 16px;
  font-weight: 800;
  margin-top: 2px;
}

.market-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-top: 1px solid var(--gray-dark);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent);
}

.currency-toggle {
  background: var(--primary-light);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--white);
}

.bid-ask-container {
  display: flex;
  padding: 8px 16px;
  gap: 32px;
}

.price-item .label {
  font-size: 10px;
  color: var(--gray);
  text-transform: uppercase;
}

.price-item .value {
  font-size: 16px;
  font-weight: 700;
}

.price-item .value.up {
  color: var(--success);
}

.price-item .value.down {
  color: var(--danger);
}

.trade-panel {
  padding: 16px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
}

.buy-sell-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-trade {
  height: 48px;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  color: #000;
  font-size: 14px;
}

.btn-buy {
  background: var(--accent);
}

.btn-sell {
  background: var(--danger);
  color: #fff;
}

.input-label {
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 600;
}

.amount-input-wrapper {
  background: var(--primary-light);
  border: 1px solid var(--gray-dark);
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}

.amount-input-wrapper span {
  color: var(--gray);
  font-weight: 700;
  margin-right: 8px;
}

.amount-input-wrapper input {
  background: transparent;
  border: none;
  color: white;
  font-weight: 700;
  font-size: 16px;
  width: 100%;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.preset-btn {
  background: var(--primary-light);
  border: 1px solid var(--gray-dark);
  border-radius: 4px;
  color: var(--white);
  padding: 10px 0;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}

.preset-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.trade-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}

.trade-info-row .label {
  color: var(--gray);
}

.live-chat-section {
  padding: 16px;
  background: var(--primary);
}

.chat-card {
  background: var(--primary-light);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.chat-message {
  font-size: 13px;
  line-height: 1.4;
}

.chat-system {
  color: var(--accent);
  font-weight: 700;
}

.chat-check {
  width: 16px;
  height: 16px;
  background: rgba(192, 132, 252, 0.2);
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-trade {
  height: 54px;
  border: none;
  border-radius: 4px;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.1s;
  z-index: 10;
}

.btn-trade:active {
  transform: scale(0.96);
}

.btn-buy {
  background: #00FFA3;
  color: #000;
}

.btn-sell {
  background: #FF4D4D;
  color: #fff;
}

.processing-overlay {
  background: #00FFA3;
  color: #000;
  padding: 24px;
  border-radius: 4px;
  text-align: center;
  margin-top: 20px;
}

.processing-title {
  font-weight: 900;
  font-size: 18px;
  text-transform: uppercase;
}

.processing-result {
  font-weight: 700;
  font-size: 16px;
}

.float-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
  z-index: 100;
}

/* === Notifications === */
.notification-banner {
  background: var(--primary-light);
  border-bottom: 2px solid var(--accent);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.notification-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
}

.notification-result {
  font-weight: 700;
}

.notification-close {
  color: var(--gray);
  font-size: 18px;
  cursor: pointer;
}

/* === Enhanced Gradients === */
.btn-buy-processing {
  background: linear-gradient(90deg, #00FFA3, #00D186);
  box-shadow: 0 0 20px rgba(0, 255, 163, 0.4);
}

.btn-sell-processing {
  background: linear-gradient(90deg, #FF4D4D, #D13B3B);
  box-shadow: 0 0 20px rgba(255, 77, 77, 0.4);
  color: white !important;
}

.toast-custom {
  background: var(--primary-light);
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* === Section Headers === */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  margin-top: 24px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
}

.section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* === Badge === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.badge-demo {
  background: rgba(34, 197, 94, 0.15);
  color: var(--warning);
}

.badge-live {
  background: rgba(0, 200, 83, 0.15);
  color: var(--success);
}

.badge-pending {
  background: rgba(34, 197, 94, 0.15);
  color: var(--warning);
}

.badge-success {
  background: rgba(0, 200, 83, 0.15);
  color: var(--success);
}

.badge-failed {
  background: rgba(255, 61, 87, 0.15);
  color: var(--danger);
}

/* === Quick Actions === */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--gray-300);
  transition: var(--transition);
  cursor: pointer;
}

.quick-action:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.quick-action-icon {
  font-size: 24px;
}

.quick-action-label {
  font-size: 11px;
  font-weight: 600;
}

/* === TradingView Chart Container === */
.chart-container {
  width: 100%;
  height: 350px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  margin-bottom: 16px;
}

/* === Lot Size Input === */
.lot-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 4px;
}

.lot-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--glass-light);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.lot-btn:hover {
  background: var(--accent);
  color: #FFFFFF;
}

.lot-value {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  background: transparent;
  border: none;
  color: var(--white);
  outline: none;
}

/* === Auth Pages === */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.auth-logo {
  text-align: center;
  margin-bottom: 40px;
}

.auth-logo .logo-icon {
  width: 56px;
  height: 56px;
  background: var(--brand-gradient);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 22px;
  color: #FFFFFF;
  margin-bottom: 12px;
}

.auth-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.auth-subtitle {
  color: var(--gray-400);
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--gray-400);
  font-size: 14px;
}

.auth-footer a {
  color: var(--accent);
  font-weight: 600;
}

.form-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

/* === Admin Layout === */
.admin-layout {
  min-height: 100vh;
  background: var(--primary-dark);
}

.admin-header {
  background: var(--glass);
  backdrop-filter: blur(20px);
  padding: 16px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--primary);
  border-bottom: 1px solid var(--glass-border);
}

.admin-tabs::-webkit-scrollbar {
  display: none;
}

.admin-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.admin-tab:hover,
.admin-tab.active {
  background: var(--accent);
  color: #FFFFFF;
}

.admin-content {
  padding: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.admin-stat {
  text-align: center;
  padding: 20px;
}

.admin-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}

.admin-stat-label {
  font-size: 12px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* === Table === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--gray-400);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--glass-border);
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--gray-200);
}

.data-table tr:hover td {
  background: var(--glass-light);
}

/* === Animations === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }

  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.animate-fadeInUp {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.animate-delay-1 {
  animation-delay: 0.1s;
}

.animate-delay-2 {
  animation-delay: 0.2s;
}

.animate-delay-3 {
  animation-delay: 0.3s;
}

.animate-delay-4 {
  animation-delay: 0.4s;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* === Status dot === */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

.status-dot.offline {
  background: var(--gray-500);
}

/* === Divider === */
.divider {
  height: 1px;
  background: var(--glass-border);
  margin: 16px 0;
}

/* === Utility === */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.w-full {
  width: 100%;
}

.font-bold {
  font-weight: 700;
}

.text-sm {
  font-size: 13px;
}

.text-xs {
  font-size: 11px;
}

.text-gray {
  color: var(--gray-400);
}

.hidden {
  display: none !important;
}

/* === Hero Section === */
.hero {
  text-align: center;
  padding: 32px 0;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--white), var(--gray-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h1 span {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--gray-400);
  font-size: 14px;
  max-width: 320px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  margin: 0 auto;
}

/* === Stats Grid === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.stat-card {
  text-align: center;
  padding: 16px 8px;
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: 10px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* === Toast === */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  z-index: 3000;
  transition: transform 0.4s ease;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: var(--accent);
  color: #FFFFFF;
}

.toast.error {
  background: var(--danger);
  color: var(--white);
}

.toast.info {
  background: var(--info);
  color: var(--white);
}

/* === Loading === */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  flex-direction: column;
  gap: 16px;
}

.loading-text {
  color: var(--gray-300);
  font-size: 14px;
  font-weight: 500;
}

/* === Responsive (tablets and up) === */
@media (min-width: 768px) {
  .page-content {
    max-width: 600px;
  }

  .bottom-nav {
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .hero h1 {
    font-size: 36px;
  }

  .balance-amount {
    font-size: 40px;
  }

  .chart-container {
    height: 450px;
  }
}
/* === User Side Menu (left drawer + desktop rail) ===
   Solid surfaces, no glass: opaque greens, hairline borders, accent edge. */
.um-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 88vw;
  z-index: 2000;
  background: var(--primary);
  border-right: 1px solid rgba(168, 85, 247, 0.14);
  transform: translateX(-102%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.um-drawer.open {
  transform: translateX(0);
  box-shadow: 24px 0 60px rgba(0, 0, 0, 0.55);
}

.um-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(1, 11, 11, 0.72);
  z-index: 1999;
}

body.um-locked { overflow: hidden; }

.um-rail {
  position: fixed;
  left: 0;
  top: 134px;
  bottom: 0;
  width: 280px;
  display: none;
  z-index: 900;
  background: var(--primary);
  border-right: 1px solid rgba(168, 85, 247, 0.12);
}

.um-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--primary);
  color: var(--text);
}

.um-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.um-top .brand-name { font-size: 17px; }

.um-x {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-light);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.um-x:hover { background: var(--primary-dark); color: var(--white); }

.um-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-bottom: 8px;
}

.um-scroll::-webkit-scrollbar { width: 4px; }
.um-scroll::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.18); border-radius: 4px; }

.um-card {
  margin: 14px 14px 2px;
  padding: 14px;
  border-radius: 16px;
  background: var(--primary-light);
  border: 1px solid rgba(168, 85, 247, 0.14);
}

.um-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.um-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-gradient);
  color: #FFFFFF;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.um-avatar--demo { background: var(--primary-light); color: var(--accent); border: 1px solid rgba(168, 85, 247, 0.3); }

.um-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.um-meta {
  font-size: 10.5px;
  color: var(--gray-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.um-funds {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.um-funds-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gray-600);
}

.um-funds-value {
  font-size: 16px;
  font-weight: 900;
  color: var(--white);
  margin-top: 2px;
}

.um-funds-value .currency { color: var(--accent); }

  .um-deposit-btn {
  background: linear-gradient(to right, #F5C542 0%, #D4A017 51%, #F5C542 100%);
  background-size: 200% auto;
  color: #000;
  border: 0;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-decoration: none;
  white-space: nowrap;
  transition: 0.4s;
}

.um-deposit-btn:hover { background-position: right center; }

.um-guest-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

.um-guest-title { font-size: 13.5px; font-weight: 800; color: var(--white); margin-bottom: 2px; }
.um-guest-sub { font-size: 11px; color: var(--gray-500); line-height: 1.5; margin-bottom: 10px; }

.um-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  transition: var(--transition-fast);
}

.um-btn--primary { background: var(--brand-gradient); color: #fff; }
.um-btn--primary:hover { filter: brightness(1.08); }
.um-btn--ghost { background: var(--primary-light); color: var(--gray-200); border: 1px solid rgba(255, 255, 255, 0.09); }
.um-btn--ghost:hover { background: var(--primary-dark); color: var(--white); }

.um-group { margin-top: 18px; padding: 0 14px; }

.um-group-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--gray-600);
  padding: 0 10px 8px;
}

.um-nav { display: flex; flex-direction: column; gap: 2px; }

.um-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--gray-300);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
}

.um-link > .mi {
  font-size: 20px;
  width: 22px;
  justify-content: center;
  color: var(--gray-500);
  transition: var(--transition-fast);
  margin-right: 0;
}

button.um-link > .mi { margin-right: 0; }

.um-link:hover { background: var(--primary-dark); color: var(--white); }
.um-link:hover > .mi { color: var(--accent-2); }

.um-link.active {
  background: rgba(168, 85, 247, 0.1);
  color: var(--white);
  font-weight: 700;
}

.um-link.active > .mi { color: var(--accent); }

.um-link.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand-gradient);
}

.um-tag {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.um-arrow { margin-left: auto; font-size: 16px; color: var(--gray-600); }
.um-link.active .um-arrow { color: var(--accent); }

.um-link--danger { color: #FF8A8A; }
.um-link--danger > .mi { color: #B06060; }
.um-link--danger:hover { background: rgba(255, 77, 77, 0.08); color: var(--white); }
.um-link--danger:hover > .mi { color: var(--danger); }

.um-divider { height: 1px; background: rgba(255, 255, 255, 0.06); margin: 16px 14px 0; }

.um-foot {
  flex-shrink: 0;
  padding: 12px 24px 16px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--gray-600);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 10px;
}

@media (min-width: 1024px) {
  .um-rail { display: block; }
}

/* === Bottom-sheet modal actions === */
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.modal-actions .btn { flex: 1; width: auto; }
.modal-actions .btn-primary { flex: 1.6; }

/* === Compact transfer bottom-sheet === */
.modal-content.modal--compact {
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
}

.modal--compact .modal-handle { margin-bottom: 10px; }
.modal--compact .modal-title { font-size: 16px; margin-bottom: 2px; }
.modal--compact .modal-text { font-size: 12px; margin-bottom: 14px; }
.modal--compact .form-group { margin-bottom: 12px; }
.modal--compact .form-label { font-size: 10.5px; margin-bottom: 5px; }
.modal--compact .form-input { padding: 11px 14px; font-size: 14px; border-radius: 10px; }
.modal--compact .modal-actions { margin-top: 14px; }
.modal--compact .modal-actions .btn { padding: 11px 14px; font-size: 12.5px; }

.tm-balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.10), rgba(62, 7, 149, 0.04));
  border: 1px solid rgba(168, 85, 247, 0.22);
}

.tm-balance-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gray-500);
}

.tm-balance-value {
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  color: var(--white);
  margin-top: 4px;
}

.tm-balance-value .cur { color: var(--accent); font-size: 14px; font-weight: 800; margin-right: 1px; }

.tm-max-btn {
  background: rgba(168, 85, 247, 0.12);
  color: var(--accent);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.tm-max-btn:hover { background: rgba(168, 85, 247, 0.2); }
.tm-max-btn:active { transform: scale(0.95); }

.tm-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tm-label-row .form-label { margin-bottom: 5px; }
.tm-min-hint { font-size: 10.5px; font-weight: 600; color: var(--gray-500); letter-spacing: 0; text-transform: none; }
.tm-preview { margin-top: 6px; font-size: 12px; min-height: 1.1em; }

.modal-actions--stack { flex-direction: column; }
.modal-actions--stack .btn { flex: none; width: 100%; }


/* ============================================
   LIGHT THEME
   Toggled via <html data-theme="light">. Design tokens are remapped here;
   attribute-pattern rules below neutralise hardcoded inline colours.
   ============================================ */
[data-theme="light"] {
  /* --- Surfaces --- */
  --primary: #F2F0F7;
  --primary-light: #FFFFFF;
  --primary-dark: #170224; /* text on accent: near-black violet */

  /* --- Brand accents (darker for contrast on white) --- */
  --accent: #B8860B;
  --accent-2: #A67C00;
  --accent-dark: #8F6A00;
  --accent-soft: rgba(184, 134, 11, 0.10);
  --accent-glow: rgba(184, 134, 11, 0.22);
  --brand-gradient: linear-gradient(159deg, #170224 0%, #4C1D95 100%);

  /* --- Status --- */
  --danger: #D93025;
  --success: #00A843;
  --warning: #B8860B;
  --info: #6D28D9;

  /* --- Text --- */
  --white: #1A1423; /* components use var(--white) for text */
  --text: #1A1423;
  --gray: #5C5470;
  --gray-200: #413A50;
  --gray-300: #4E4663;
  --gray-400: #5C5470;
  --gray-500: #6E6482;
  --gray-600: #8B81A0;
  --gray-dark: #E3DEF0;

  /* --- Glass, borders --- */
  --glass: rgba(255, 255, 255, 0.82);
  --glass-light: rgba(32, 24, 46, 0.04);
  --glass-border: rgba(147, 51, 234, 0.18);
  --border: rgba(32, 24, 46, 0.12);

  /* --- Shadows --- */
  --shadow-glow: 0 0 24px rgba(184, 134, 11, 0.16);
  --shadow-lg: 0 18px 40px -12px rgba(32, 24, 46, 0.18);
}

/* Neon green inline text -> readable green */
[data-theme="light"] [style*="39FF14"],
[data-theme="light"] [style*="39ff14"],
[data-theme="light"] [style*="#00FFA3"],
[data-theme="light"] [style*="#00ffa3"] { color: #9333EA !important; }

/* White inline text -> dark ink */
[data-theme="light"] [style*="color: white"],
[data-theme="light"] [style*="color:white"] { color: #1A1423 !important; }

/* Gold inline text -> darker gold for light bg */
[data-theme="light"] [style*="color: gold"],
[data-theme="light"] [style*="color:gold"] { color: #9A7500 !important; }

/* White-alpha chip/row backgrounds -> ink-alpha */
[data-theme="light"] [style*="background: rgba(255,255,255"],
[data-theme="light"] [style*="background: rgba(255, 255, 255"],
[data-theme="light"] [style*="background:rgba(255,255,255"] { background: rgba(32, 24, 46, 0.04) !important; }

/* White-alpha borders -> ink-alpha */
[data-theme="light"] [style*="border: 1px solid rgba(255,255,255"],
[data-theme="light"] [style*="border: 1px solid rgba(255, 255, 255"],
[data-theme="light"] [style*="border-top: 1px solid rgba(255,255,255"],
[data-theme="light"] [style*="border-bottom: 1px solid rgba(255,255,255"] { border-color: rgba(32, 24, 46, 0.10) !important; }

/* Hardcoded dark surfaces -> light surfaces */
[data-theme="light"] [style*="06231A"],
[data-theme="light"] [style*="06231a"],
[data-theme="light"] [style*="03150D"],
[data-theme="light"] [style*="03150d"] { background: #FFFFFF !important; }

/* Dark header glass -> light glass */
[data-theme="light"] [style*="rgba(3, 21, 13"],
[data-theme="light"] [style*="rgba(3,21,13"] { background: rgba(255, 255, 255, 0.90) !important; }

/* Hamburger / light text surfaces -> ink */
[data-theme="light"] [style*="EAFBF0"],
[data-theme="light"] [style*="eafbf0"] { background: #1A1423 !important; color: #1A1423 !important; }

/* Page-level dark overrides (set via <style> blocks, not inline attrs) */
[data-theme="light"] .page-content { background: var(--primary) !important; }
[data-theme="light"] .top-header { border-bottom-color: var(--border) !important; box-shadow: 0 1px 0 rgba(32, 24, 46, 0.06); }
[data-theme="light"] .card,
[data-theme="light"] .pf-card { box-shadow: 0 1px 3px rgba(32, 24, 46, 0.06); }
[data-theme="light"] .ai-scanner-container { background: rgba(255, 255, 255, 0.85) !important; border-color: var(--border) !important; }
[data-theme="light"] .processing-overlay,
[data-theme="light"] .result-card { filter: none; }

/* === Theme toggle button === */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--glass-light);
  color: var(--accent);
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent-glow); box-shadow: var(--shadow-glow); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle .mi { font-size: 17px; }

@media (max-width: 420px) {
  .top-header { gap: 10px !important; padding: 0 12px !important; }
  .header-actions { gap: 8px !important; }
  .theme-toggle { width: 30px; height: 30px; }
  .theme-toggle .mi { font-size: 15px; }
}
