/**
 * Kazafi Trading Platform V2
 * frontend/public/index.css
 *
 * Kazafi Platform Styling & Midnight Theme.
 */

/* ── Reset & Base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0f1e;
  --chart-bg:  #0e1424;
  --grid:      #141c30;
  --bull:      #25D366;
  --bear:      #ef4444;
  --text:      #e2e8f0;
  --text-dim:  #94a3b8;
  --toolbar:   #0f172a;
  --border:    rgba(212, 175, 55, 0.22);
  --active:    #10b981;
  --gold:      #d4af37;
  --cyan:      #38bdf8;
  --purple:    #c084fc;
  --surface:   #141c30;
  --surface2:  #1e293b;

  --font: 'Inter', 'Roboto', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 10px;
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-dark {
  --bg: #0d0d0d;
  --chart-bg: #111111;
  --grid: #1e1e2e;
  --toolbar: #141414;
  --border: #2a2a3e;
}

body.theme-light {
  --bg: #f8fafc;
  --chart-bg: #ffffff;
  --grid: #e2e8f0;
  --toolbar: #f1f5f9;
  --text: #1e293b;
  --text-dim: #64748b;
  --border: #cbd5e1;
}

html, body {
  height: 100%;
  width: 100%;
  max-width: 100vw;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── App Layout ──────────────────────────────────────────────────────────────── */
#app {
  display: grid;
  grid-template-rows: auto 1fr 28px;
  grid-template-columns: 100%;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
}

/* ── Kazafi Navigation Toolbar ─────────────────────────────────────────────────── */
#toolbar {
  background: linear-gradient(180deg, #0d1527 0%, #0a0f1e 100%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  padding: 5px 8px;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  max-width: 100vw;
  overflow: visible;
  position: relative;
}

.kazafi-toolbar-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  position: relative;
}

.kazafi-toolbar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: visible;
  max-width: 100%;
  white-space: nowrap;
  padding-bottom: 2px;
  position: relative;
}

/* ── Brand Pair & Logo ──────────────────────────────────────────────────────── */
.kazafi-brand-pair {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  padding-right: 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.kazafi-logo-base { color: #ffffff; }
.kazafi-logo-slash { color: #14b8a6; margin: 0 1px; }
.kazafi-logo-quote { color: #14b8a6; }

/* ── Modern Kazafi MT4 Symbol Picker ───────────────────────────────────────── */
.kazafi-symbol-picker {
  position: relative;
  display: inline-block;
  user-select: none;
}

.kazafi-symbol-trigger {
  background: linear-gradient(135deg, rgba(20, 28, 48, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: var(--radius);
  color: #f1f5f9;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.kazafi-symbol-trigger:hover {
  border-color: #fbbf24;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.35);
  transform: translateY(-1px);
}

.kazafi-symbol-picker.open .kazafi-symbol-trigger {
  border-color: #14b8a6;
  box-shadow: 0 0 14px rgba(20, 184, 166, 0.4);
}

.kazafi-symbol-trigger .sym-icon {
  font-size: 13px;
}

.kazafi-symbol-trigger .sym-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fbbf24;
}

.kazafi-symbol-trigger .sym-type-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: 3px;
}

.kazafi-symbol-trigger .sym-chevron {
  font-size: 9px;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.kazafi-symbol-picker.open .sym-chevron {
  transform: rotate(180deg);
  color: #14b8a6;
}

/* Badge types */
.badge-metal { background: rgba(212, 175, 55, 0.2); color: #fbbf24; border: 1px solid rgba(212, 175, 55, 0.4); }
.badge-forex { background: rgba(20, 184, 166, 0.2); color: #2dd4bf; border: 1px solid rgba(20, 184, 166, 0.4); }
.badge-crypto { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.badge-commodity { background: rgba(249, 115, 22, 0.2); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.4); }
.badge-index { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }

/* ── Clean Direct Symbol Dropdown Menu ─────────────────────────────────────── */
.kazafi-symbol-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 260px;
  max-height: 400px;
  overflow-y: auto;
  background: rgba(13, 21, 39, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 3px;
  z-index: 500;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
}

.kazafi-dropdown.open .kazafi-symbol-menu {
  display: flex;
}

.kazafi-symbol-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.kazafi-symbol-trigger .sym-name {
  color: #fbbf24;
  font-weight: 800;
}

/* ── Form Controls & Selects ─────────────────────────────────────────────────── */
.kazafi-select {
  background: rgba(20, 28, 48, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-sm);
  color: #fbbf24;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.kazafi-select:hover, .kazafi-select:focus {
  border-color: #d4af37;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}

.kazafi-select option {
  background: #0f172a;
  color: #fff;
}

/* ── Timeframe Pills ─────────────────────────────────────────────────────────── */
.kazafi-timeframes {
  display: flex;
  align-items: center;
  gap: 4px;
}

.kazafi-tf-btn {
  background: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.kazafi-tf-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.kazafi-tf-btn.active {
  background: #14b8a6;
  color: #042f2e;
  border-color: #14b8a6;
  box-shadow: 0 0 8px rgba(20, 184, 166, 0.4);
}

/* ── Candle Countdown Timer Badge ─────────────────────────────────────────── */
.kazafi-countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
  margin-left: 4px;
  user-select: none;
}

.kazafi-countdown-badge .timer-icon {
  font-size: 10px;
  opacity: 0.85;
  animation: pulseTimer 1s infinite alternate;
}

@keyframes pulseTimer {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

/* ── Timezone Picker (UTC+5 Default) ────────────────────────────────────────── */
.kazafi-tz-picker {
  position: relative;
  display: inline-block;
  margin-left: 6px;
  user-select: none;
}

.kazafi-tz-btn {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-sm);
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.kazafi-tz-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.kazafi-tz-picker.open .kazafi-tz-btn {
  border-color: #fbbf24;
  color: #fbbf24;
}

.kazafi-tz-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 225px;
  background: rgba(13, 21, 39, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 3px;
  z-index: 300;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
}

.kazafi-tz-picker.open .kazafi-tz-menu {
  display: flex;
}

.kazafi-tz-menu-header {
  font-size: 10px;
  font-weight: 800;
  color: #fbbf24;
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kazafi-tz-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 5px;
  background: rgba(30, 41, 59, 0.5);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.kazafi-tz-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.kazafi-tz-item.active {
  background: #14b8a6 !important;
  color: #042f2e !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.35);
}

/* ── Buttons & Dropdowns ─────────────────────────────────────────────────────── */
.kazafi-btn {
  background: rgba(20, 28, 48, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
  user-select: none;
}

.kazafi-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #fff;
  border-color: rgba(212, 175, 55, 0.4);
}

.kazafi-btn.active {
  background: rgba(20, 184, 166, 0.15);
  border-color: #14b8a6;
  color: #2dd4bf;
  box-shadow: 0 0 8px rgba(20, 184, 166, 0.25);
}

.kazafi-dropdown {
  position: relative;
  display: inline-block;
}

.kazafi-dropdown-trigger .caret {
  font-size: 9px;
  opacity: 0.7;
}

.kazafi-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 165px;
  background: rgba(13, 21, 39, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 3px;
  z-index: 200;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
  max-height: 420px;
  overflow-y: auto;
}

.kazafi-dropdown.open .kazafi-dropdown-menu {
  display: flex;
}

.kazafi-menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 5px;
  background: rgba(30, 41, 59, 0.5);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.kazafi-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.kazafi-menu-item.active {
  background: #ef4444 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.kazafi-menu-item.active span {
  color: #ffffff !important;
  font-weight: 700 !important;
}

/* ── Main Chart Area ─────────────────────────────────────────────────────────── */
#chart-area {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#chart-container {
  width: 100%;
  height: 100%;
  position: relative;
}

/* ── Complete Removal of TradingView Attribution / Watermark ──────────────── */
#tv-attr-logo,
.tv-attr-logo,
a[href*="tradingview.com"],
a[title*="TradingView"],
#chart-container a,
#chart-container a#tv-attr-logo,
#chart-container img[alt*="TradingView"],
#chart-container svg[aria-label*="TradingView"],
#chart-container div[style*="z-index: 2"] a,
#chart-container div[style*="z-index: 1"] a,
#chart-container div[style*="z-index: 3"] a,
#chart-container tr:last-child td:first-child a {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  left: -9999px !important;
}

/* ── Status Narrative Card ───────────────────────────────────────────────────── */
.kazafi-narrative-card {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kazafi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
}

.kazafi-verdict-badge {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
}

.kazafi-verdict-badge.buy {
  background: rgba(37, 211, 102, 0.2);
  color: #25D366;
  border: 1px solid rgba(37, 211, 102, 0.4);
}

.kazafi-live-pulse {
  color: #25D366;
  font-weight: 700;
  font-size: 10px;
}

.kazafi-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #94a3b8;
}

.kazafi-card-body .lbl {
  color: #64748b;
  margin-right: 4px;
}

.kazafi-card-body strong {
  color: #f1f5f9;
}

/* ── Status Bar ──────────────────────────────────────────────────────────────── */
#statusbar {
  background: #080c18;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 11px;
  color: #64748b;
  z-index: 50;
}

/* ── Loading Overlay ─────────────────────────────────────────────────────────── */
#loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 200ms ease;
}

#loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.loader__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(212, 175, 55, 0.2);
  border-top-color: #d4af37;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Multi-Chart Grid System ─────────────────────────────────────────────────── */
.multi-chart-grid {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 4px;
  padding: 4px;
  background: #080c18;
  z-index: 10;
}

.multi-chart-grid.hidden {
  display: none !important;
}

.multi-chart-grid.grid-2  { grid-template-columns: repeat(2, 1fr); grid-template-rows: 1fr; }
.multi-chart-grid.grid-4  { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); }
.multi-chart-grid.grid-6  { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
.multi-chart-grid.grid-8  { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); }
.multi-chart-grid.grid-10 { grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(2, 1fr); }
.multi-chart-grid.grid-12 { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); }
.multi-chart-grid.grid-14 { grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(2, 1fr); }

.chart-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #0e1424;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 150ms ease;
}

.chart-tile:hover {
  border-color: rgba(229, 184, 66, 0.4);
}

.tile-header {
  height: 26px;
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  background: #131b2e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  user-select: none;
  z-index: 5;
}

.tile-controls-left,
.tile-controls-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tile-sym-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #fff;
  font-size: 11px;
  padding: 1px 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 2px;
}

.tile-sym-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--gold, #d4af37);
}

.tile-tf-select {
  background: #0a0f1e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 3px;
  outline: none;
  cursor: pointer;
}

.tile-price-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #22c55e;
  margin-right: 4px;
}

.tile-tool-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 3px;
}

.tile-tool-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.tile-chart-mount {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.tile-canvas-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.tile-sym-popup {
  position: absolute;
  z-index: 99999;
  background: #0e1424;
  border: 1px solid rgba(229, 184, 66, 0.35);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.75);
  padding: 8px;
  width: 280px;
  max-height: 340px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tile-popup-header {
  width: 100%;
}

.tile-popup-search {
  width: 100%;
  box-sizing: border-box;
  background: #080c18;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  padding: 6px 8px;
  outline: none;
}

.tile-popup-search:focus {
  border-color: var(--gold, #d4af37);
}

.tile-popup-tabs {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tile-popup-tab {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  cursor: pointer;
  white-space: nowrap;
}

.tile-popup-tab.active {
  background: var(--gold, #d4af37);
  color: #000;
  border-color: var(--gold, #d4af37);
}

.tile-popup-list {
  flex: 1;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tile-sym-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  font-size: 11px;
  color: #e2e8f0;
  border-radius: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: background 120ms ease;
}

.tile-sym-item:hover {
  background: rgba(37, 99, 235, 0.35);
  border-left: 2px solid var(--gold, #d4af37);
}

.tile-item-sym {
  font-weight: 700;
  color: #fff;
}

.tile-item-desc {
  font-size: 10px;
  color: #94a3b8;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-popup-empty {
  padding: 16px;
  text-align: center;
  color: #64748b;
  font-size: 11px;
}

.tile-maximized {
  position: absolute !important;
  inset: 0 !important;
  z-index: 50 !important;
  width: 100% !important;
  height: 100% !important;
}

.tile-hidden {
  display: none !important;
}

/* ── Universal Responsive & Mobile/Tablet Support ───────────────────────────── */
.kazafi-btn,
.kazafi-tf-btn,
.kazafi-symbol-trigger,
.kazafi-tz-btn,
.kazafi-countdown-badge {
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  #toolbar {
    padding: 5px 8px;
  }
  .kazafi-toolbar-row {
    gap: 5px;
  }
  .kazafi-btn {
    padding: 3px 7px;
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  #toolbar {
    padding: 4px 6px;
    overflow-x: hidden;
  }

  .kazafi-toolbar-row {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .kazafi-toolbar-row::-webkit-scrollbar {
    display: none;
  }
  
  .kazafi-brand-pair {
    font-size: 13px;
    padding-right: 5px;
  }

  .kazafi-symbol-trigger {
    padding: 3px 6px;
    font-size: 11px;
    gap: 4px;
  }

  .kazafi-btn {
    padding: 2.5px 6px;
    font-size: 10.5px;
    gap: 3px;
  }

  .kazafi-tf-btn {
    padding: 2px 5px;
    font-size: 10.5px;
  }

  .kazafi-countdown-badge {
    padding: 2px 5px;
    font-size: 10px;
  }

  /* Fixed Position Modals for Clean Mobile Viewing */
  .kazafi-symbol-menu {
    position: fixed !important;
    top: 55px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    max-height: 75vh !important;
    z-index: 1000 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95);
  }

  .kazafi-dropdown-menu {
    position: fixed !important;
    top: auto !important;
    bottom: 32px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    max-height: 60vh !important;
    z-index: 1000 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95);
  }

  .kazafi-tz-menu {
    position: fixed !important;
    top: auto !important;
    bottom: 32px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    max-height: 60vh !important;
    z-index: 1000 !important;
  }

  #statusbar {
    padding: 0 8px;
    font-size: 10px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  #toolbar {
    padding: 3px 4px;
  }

  .kazafi-toolbar-wrap {
    gap: 3px;
  }

  .kazafi-toolbar-row {
    gap: 4px;
    padding-bottom: 2px;
  }

  .kazafi-brand-pair {
    font-size: 12px;
    padding-right: 4px;
  }

  .kazafi-symbol-trigger .sym-name {
    font-size: 11px;
  }

  .kazafi-symbol-trigger .sym-type-badge {
    display: none; /* Hide badge on tiny mobile screens for max space */
  }

  .kazafi-btn {
    padding: 2px 5px;
    font-size: 10px;
  }

  .kazafi-tf-btn {
    padding: 2px 4px;
    font-size: 10px;
  }

  #statusbar {
    font-size: 9.5px;
  }
}


