:root {
  --bg-dark: #181a20;
  --bg-card: #1e2329;
  --bg-card-hover: #2b313a;
  --bg-inset: #14171a;
  --border: #2b313a;
  --border-light: #363d47;
  --text-main: #eaecef;
  --text-muted: #848e9c;
  --primary: #f0b90b;
  --primary-hover: #fcd535;
  --primary-active: #d9a407;
  --primary-text: #181a20;
  --accent-binance: #f0b90b;
  --accent-coingecko: #8dc63f;
  --success: #0ecb81;
  --success-hover: #0ba569;
  --danger: #f6465d;
  --danger-hover: #d9384e;
  --warning: #f0b90b;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Binance Header */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.8rem;
  background-color: #181a20;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-main);
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.nav-badges {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.badge {
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-pulse {
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.badge-success { background: rgba(14, 203, 129, 0.15); color: #0ecb81; border: 1px solid rgba(14, 203, 129, 0.3); }
.badge-success .badge-dot { background: #0ecb81; }

.badge-danger { background: rgba(246, 70, 93, 0.15); color: #f6465d; border: 1px solid rgba(246, 70, 93, 0.3); }
.badge-danger .badge-dot { background: #f6465d; }

.badge-warning { background: rgba(240, 185, 11, 0.15); color: #f0b90b; border: 1px solid rgba(240, 185, 11, 0.3); }
.badge-warning .badge-dot { background: #f0b90b; }

.badge-info { background: rgba(240, 185, 11, 0.12); color: #f0b90b; border: 1px solid rgba(240, 185, 11, 0.25); }
.badge-info .badge-dot { background: #f0b90b; }

.badge-binance { background: rgba(240, 185, 11, 0.15); color: #f0b90b; border: 1px solid rgba(240, 185, 11, 0.3); }
.badge-coingecko { background: rgba(141, 198, 63, 0.15); color: #8dc63f; border: 1px solid rgba(141, 198, 63, 0.3); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Binance Pro Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-text);
  font-weight: 700;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  color: var(--primary-text);
}

.btn-success {
  background-color: var(--success);
  color: white;
}
.btn-success:hover {
  background-color: var(--success-hover);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}
.btn-danger:hover {
  background-color: var(--danger-hover);
}

.btn-secondary {
  background-color: #2b313a;
  color: var(--text-main);
  border-color: #363d47;
}
.btn-secondary:hover {
  background-color: #363d47;
  color: #ffffff;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.72rem;
  border-radius: 4px;
}

/* Main Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

/* Summary Grid - Binance Pro Style */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--border-light);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.3rem;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.card-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
}

/* Two Column Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Section Titles */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* AI Signals Cards */
.signals-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.signal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.15rem;
  transition: transform 0.15s, border-color 0.15s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.signal-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.signal-card.signal-buy {
  border-left: 4px solid var(--success);
}

.signal-card.signal-sell {
  border-left: 4px solid var(--danger);
}

.signal-card.signal-hold {
  border-left: 4px solid var(--text-muted);
}

.signal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.coin-identity {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.coin-symbol {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.coin-price {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.signal-badge-big {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.confidence-bar-wrapper {
  margin-bottom: 0.8rem;
}

.confidence-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.confidence-bar-bg {
  width: 100%;
  height: 5px;
  background-color: #2b313a;
  border-radius: 3px;
  overflow: hidden;
}

.confidence-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.signal-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  background-color: var(--bg-inset);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 0.6rem;
  margin-bottom: 0.8rem;
  font-size: 0.74rem;
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-name {
  color: var(--text-muted);
}

.metric-val {
  font-weight: 600;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.signal-reasoning {
  font-size: 0.8rem;
  color: var(--text-main);
  background: rgba(240, 185, 11, 0.05);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--primary);
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.signal-reasoning-cebuano {
  font-size: 0.78rem;
  color: #fcd535;
  margin-top: 0.3rem;
  font-style: italic;
}

.signal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.target-points {
  display: flex;
  gap: 1rem;
}

/* CoinGecko Trending List */
.trending-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.trending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background-color: #0d131f;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.trending-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.trending-rank {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 22px;
}

.trending-img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.trending-symbol {
  font-weight: 600;
  font-size: 0.85rem;
}

.trending-name {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Binance Pro Tables */
.table-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

th {
  background-color: #14171a;
  padding: 0.75rem 1rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #23272e;
  font-variant-numeric: tabular-nums;
}

tr:hover td {
  background-color: var(--bg-card-hover);
}

/* Binance Terminal Logs */
.terminal-window {
  background-color: #0b0e11;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  max-height: 280px;
  overflow-y: auto;
}

.log-entry {
  display: flex;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.log-time {
  color: #6b7280;
  min-width: 75px;
}

.log-msg-info { color: #9ca3af; }
.log-msg-success { color: #34d399; font-weight: 600; }
.log-msg-warning { color: #fbbf24; }
.log-msg-danger { color: #f87171; font-weight: 600; }
.log-msg-trade { color: #c084fc; font-weight: 600; }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.8rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.8rem;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color 0.15s ease;
}

.close-btn:hover {
  color: #ffffff;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-input, .form-select {
  width: 100%;
  background-color: #2b313a;
  border: 1px solid #363d47;
  border-radius: 4px;
  padding: 0.65rem 0.9rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: border-color 0.15s ease;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.form-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Binance Pro Tab Navigation */
.tab-nav-wrapper {
  background: rgba(24, 26, 32, 0.98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 61px;
  z-index: 95;
  padding: 0 1.8rem;
}

.tab-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.25rem 0;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.7rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 2px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
  color: #ffffff;
  border-bottom: 2px solid var(--primary);
  background: rgba(240, 185, 11, 0.05);
}

.tab-icon {
  font-size: 0.95rem;
}

.tab-badge {
  font-size: 0.68rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: #2b313a;
  color: var(--text-muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tab-btn.active .tab-badge {
  background: var(--primary);
  color: #181a20;
}

.tab-badge-lab {
  background: rgba(240, 185, 11, 0.15);
  color: #f0b90b;
  border: 1px solid rgba(240, 185, 11, 0.3);
}

/* Tab View Switcher */
.tab-view {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.tab-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Binance Status Pills Header Cluster */
.status-pill-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: rgba(30, 35, 41, 0.9);
  color: var(--text-muted);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}

.status-pill:hover {
  border-color: var(--border-light);
  color: var(--text-main);
}

/* System Info & Strategy Lab Grid */
.system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.lab-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.lab-card:hover {
  border-color: rgba(240, 185, 11, 0.4);
}

.lab-progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin: 0.75rem 0;
}

.lab-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f0b90b, #0ecb81);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Assets Breakdown Cards */
.asset-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.asset-stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.asset-stat-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.3rem;
}

.asset-stat-val {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

/* ========================================================
   📱 Mobile-First Compact & Clean Responsive Styling
   Optimized for Android & Mobile Screen Proportions
======================================================== */
@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .navbar {
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.6rem 0.8rem;
  }
  .tab-nav-wrapper {
    top: 0;
    padding: 0 0.5rem;
  }
}

@media (max-width: 768px) {
  #badgeBtcRegime, #valCalibRegime {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    line-height: 1.25 !important;
  }

  body {
    font-size: 13px;
  }

  .container {
    padding: 0.65rem 0.65rem 4rem 0.65rem;
  }

  /* Compact Brand Header */
  .brand {
    gap: 0.45rem;
  }
  .brand-icon {
    font-size: 1.25rem;
  }
  .brand-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.3px;
  }
  .brand-subtitle {
    font-size: 0.65rem;
    line-height: 1.2;
    opacity: 0.85;
  }

  /* Compact Button Row */
  .nav-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 0.3rem;
  }
  .nav-actions .btn {
    flex: 1;
    padding: 0.35rem 0.45rem;
    font-size: 0.72rem;
    justify-content: center;
    border-radius: 6px;
  }

  /* Status Pills: Plastar 3x3 Micro-Cockpit Grid (Zero Horizontal Scroll & No Clipping) */
  .status-pill-group {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.25rem !important;
    overflow-x: visible !important;
    padding: 0.35rem 0.4rem !important;
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
  }
  .status-pill {
    padding: 0.26rem 0.32rem !important;
    font-size: 0.62rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
    border-radius: 5px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    box-shadow: none !important;
    line-height: 1.2 !important;
    background: rgba(30, 41, 59, 0.6) !important;
  }
  .status-pill span {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
  }
  .status-pill .badge-dot {
    flex-shrink: 0 !important;
    width: 6px !important;
    height: 6px !important;
  }

  /* Tab Navigation: Plastar Compact Spacing (No wide gaps) */
  .tab-nav-wrapper {
    padding: 0 0.3rem !important;
  }
  .tab-navigation {
    gap: 0.2rem !important;
    padding: 0.2rem 0 !important;
  }
  .tab-btn {
    padding: 0.32rem 0.45rem !important;
    font-size: 0.70rem !important;
    gap: 0.25rem !important;
    border-radius: 6px !important;
  }
  .tab-icon {
    font-size: 0.8rem !important;
  }
  .tab-badge {
    font-size: 0.60rem !important;
    padding: 0.08rem 0.3rem !important;
  }
  .tab-icon {
    font-size: 0.85rem;
  }
  .tab-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
  }

  /* Summary Grid: 2-Column Clean Side-by-Side Cards (Binance Mobile Style) */
  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }
  .card {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.45rem;
  }
  .card-header {
    margin-bottom: 0.35rem;
  }
  .card-title {
    font-size: 0.68rem;
    letter-spacing: 0.2px;
  }
  .card-value {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    line-height: 1.2;
  }
  .card-subtext {
    font-size: 0.68rem;
  }

  /* Asset Breakdown Boxes */
  .asset-summary-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
  }
  .asset-stat-box {
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
  }
  .asset-stat-label {
    font-size: 0.65rem;
    margin-bottom: 0.15rem;
  }
  .asset-stat-val {
    font-size: 1.05rem;
    font-weight: 700;
  }

  /* Section Titles */
  .section-header {
    margin-bottom: 0.6rem;
  }
  .section-title {
    font-size: 0.92rem;
    gap: 0.35rem;
  }

  /* Tables: Clean, Compact & Readable */
  .table-container {
    border-radius: 8px;
    overflow-x: auto;
  }
  table {
    font-size: 0.72rem;
  }
  th, td {
    padding: 0.45rem 0.55rem;
  }

  /* AI Signal Cards: Scaled Down & Balanced */
  .signals-container {
    gap: 0.65rem;
  }
  .signal-card {
    padding: 0.75rem;
    border-radius: 10px;
  }
  .signal-top {
    margin-bottom: 0.5rem;
  }
  .coin-identity {
    gap: 0.4rem;
  }
  .coin-symbol {
    font-size: 0.95rem;
  }
  .coin-price {
    font-size: 0.88rem;
  }
  .signal-badge-big {
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    border-radius: 6px;
  }
  .signal-metrics {
    padding: 0.45rem 0.55rem;
    gap: 0.35rem;
    font-size: 0.68rem;
    margin-bottom: 0.5rem;
  }
  .signal-reasoning {
    padding: 0.5rem 0.65rem;
    font-size: 0.72rem;
    margin-bottom: 0.5rem;
    line-height: 1.35;
  }
  .signal-reasoning-cebuano {
    font-size: 0.72rem;
    margin-top: 0.25rem;
  }

  /* Strategy Lab & Sentinel Cards */
  .system-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .lab-card {
    padding: 0.75rem;
    border-radius: 10px;
  }
  .lab-progress-bar {
    height: 4px;
    margin: 0.45rem 0;
  }

  /* Modals: Mobile Adaptive */
  .modal-content {
    width: 95%;
    max-height: 90vh;
    padding: 0.9rem;
    border-radius: 12px;
  }
  .modal-header {
    margin-bottom: 0.75rem;
  }
  .modal-title {
    font-size: 1rem;
  }
  .form-group {
    margin-bottom: 0.8rem;
  }
  .form-label {
    font-size: 0.74rem;
    margin-bottom: 0.25rem;
  }
  .form-input, .form-select {
    padding: 0.5rem 0.7rem;
    font-size: 0.8rem;
    border-radius: 6px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* Custom Scrollbars for AI Chat Modal (Zero Chunky Scrollbar) */
.chat-quick-chips {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.chat-quick-chips::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

#aiChatMessages {
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}
#aiChatMessages::-webkit-scrollbar {
  width: 4px;
}
#aiChatMessages::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 4px;
}

/* ==========================================================================
   Android Mobile App Compact 2x2 Stat Cards (Binance Pro App High-Density)
   ========================================================================== */
.compact-stat-card {
  padding: 0.7rem 0.85rem !important;
  border-radius: 10px !important;
  margin-bottom: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 84px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}
.compact-stat-card .card-header {
  margin-bottom: 0.25rem !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}
.compact-stat-card .card-header {
  margin-bottom: 0.25rem !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 4px !important;
  min-width: 0 !important;
}
.compact-stat-card .card-title {
  font-size: 0.68rem !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important;
}
.compact-val {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  margin: 0.15rem 0 0.25rem 0 !important;
  font-family: 'IBM Plex Mono', monospace !important;
}
.compact-sub {
  font-size: 0.68rem !important;
  color: var(--text-muted) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin-top: auto !important;
}

@media (max-width: 600px) {
  #mainSummaryGrid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.45rem !important;
    margin-bottom: 0.65rem !important;
  }
  .compact-stat-card {
    padding: 0.55rem 0.65rem !important;
    min-height: 76px !important;
  }
  .compact-val {
    font-size: 1.05rem !important;
  }
  .compact-sub {
    font-size: 0.62rem !important;
  }
}

/* Compact Android Mobile Terminal Logs */
.compact-terminal {
  font-size: 0.68rem !important;
  padding: 0.45rem 0.6rem !important;
  max-height: 135px !important;
  line-height: 1.35 !important;
  background-color: #070a0e !important;
}
.compact-terminal .log-entry {
  display: flex !important;
  gap: 0.35rem !important;
  padding: 0.12rem 0 !important;
  font-size: 0.66rem !important;
  align-items: flex-start !important;
}
.compact-terminal .log-time {
  font-size: 0.62rem !important;
  color: #64748b !important;
  white-space: nowrap !important;
  min-width: 52px !important;
  flex-shrink: 0 !important;
  font-family: 'IBM Plex Mono', monospace !important;
  font-weight: 600 !important;
}
.compact-terminal .log-msg-info,
.compact-terminal .log-msg-success,
.compact-terminal .log-msg-warning,
.compact-terminal .log-msg-danger,
.compact-terminal .log-msg-trade {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  word-break: break-word !important;
}
@media (max-width: 600px) {
  #cardTerminalLogs {
    margin-top: 0.6rem !important;
    padding: 0.5rem 0.65rem !important;
  }
  .compact-terminal {
    max-height: 125px !important;
    font-size: 0.64rem !important;
  }
  .compact-terminal .log-entry {
    font-size: 0.63rem !important;
    gap: 0.3rem !important;
  }
}

/* Strat Lab Mobile Plastar */
#tournamentSummaryGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
}

@media (max-width: 600px) {
  #tournamentSummaryGrid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.45rem !important;
    margin-bottom: 0.55rem !important;
  }
  #coinPartnerMatrixGrid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.4rem !important;
  }
}

/* Responsive Horizontal Swipe Track for Bespoke Matrix */
.coin-matrix-scroll-wrapper::-webkit-scrollbar {
  height: 4px;
}
.coin-matrix-scroll-wrapper::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.4);
  border-radius: 4px;
}
.brand-title {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
}
@media (max-width: 768px) {
  .brand-title {
    font-size: 1.10rem !important;
  }
}


/* ========================================================================= */
/* 📱 Ultra-Compact Mobile Trade History & Table Styles (Fits 100% Android)  */
/* ========================================================================= */
.table-compact-mobile {
  width: 100% !important;
  border-collapse: collapse !important;
  table-layout: fixed !important;
  font-family: inherit;
}

.table-compact-mobile th {
  background-color: #161f33 !important;
  padding: 4px 6px !important;
  font-size: 0.62rem !important;
  font-weight: 700 !important;
  color: #94a3b8 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.2px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  white-space: nowrap !important;
}

.table-compact-mobile td {
  padding: 4px 6px !important;
  font-size: 0.66rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  line-height: 1.25 !important;
  vertical-align: middle !important;
}

@media (max-width: 600px) {
  .table-compact-mobile th {
    padding: 3px 5px !important;
    font-size: 0.60rem !important;
  }
  .table-compact-mobile td {
    padding: 4px 5px !important;
    font-size: 0.64rem !important;
  }
}
