:root {
  --bg-dark: #080c14;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(6, 182, 212, 0.35);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.4);
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

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

html {
  box-sizing: border-box;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

*, *:before, *:after {
  box-sizing: inherit;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  max-width: 100vw;
  width: 100%;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* HEADER */
.app-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(8, 12, 20, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 16px 24px;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  position: relative;
}

.brand-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #000;
  border-radius: 4px;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  white-space: nowrap;
}

.brand h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.gradient-text {
  background: linear-gradient(135deg, #38bdf8, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-live-sync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.btn-live-sync:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.6);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.btn-live-sync:active {
  transform: translateY(0);
}

.btn-live-sync.is-syncing {
  opacity: 0.8;
  cursor: not-allowed;
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.15);
}

.btn-live-sync.is-syncing .sync-icon {
  display: inline-block;
  animation: spin-sync 0.8s linear infinite;
}

.btn-live-sync.sync-success {
  border-color: var(--emerald);
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.15);
}

.btn-live-sync.sync-error {
  border-color: var(--rose);
  color: #fca5a5;
  background: rgba(244, 63, 94, 0.15);
}

@keyframes spin-sync {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}

.baseline-badge {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: var(--cyan);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
}

/* MAIN LAYOUT */
.app-main {
  max-width: 1400px;
  width: 100%;
  margin: 24px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  box-sizing: border-box;
}

.layout-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  min-width: 0;
  width: 100%;
}

.layout-grid > * {
  min-width: 0;
  max-width: 100%;
}

.control-panel,
.predictions-panel {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1200px) {
  .app-header {
    padding: 12px 18px;
  }

  .header-container {
    flex-wrap: wrap;
    gap: 12px 16px;
    justify-content: space-between;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 220px;
  }

  .brand h1 {
    font-size: 21px;
  }

  .subtitle {
    font-size: 12px;
  }

  .header-status {
    flex: 0 0 auto;
    gap: 8px;
  }

  .app-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    padding: 4px;
  }

  .nav-item {
    padding: 6px 14px;
    font-size: 12.5px;
  }

  .layout-grid {
    grid-template-columns: 320px 1fr;
    gap: 18px;
  }
}

@media (max-width: 1024px) {
  .layout-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .predictions-panel {
    order: 1;
  }
  .control-panel {
    order: 2;
  }
}

/* PANELS */
.panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  min-width: 0;
  max-width: 100%;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.panel-header.flex-between {
  justify-content: space-between;
}

.icon-wrap {
  font-size: 20px;
  background: rgba(255, 255, 255, 0.05);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.panel-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.panel-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* SLIDERS */
.sliders-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.slider-group {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.slider-group:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(6, 182, 212, 0.2);
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.slider-header label {
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.weight-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--cyan);
  white-space: nowrap;
  flex-shrink: 0;
}

.styled-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #1e293b;
  outline: none;
}

.styled-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
  box-shadow: 0 0 8px var(--cyan);
  transition: transform 0.15s ease;
}

.styled-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* BUTTONS */
.button-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #04121d;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-glow {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff;
  padding: 8px 16px;
}

.btn-glow:hover {
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

.engine-pills-info {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.info-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-pill {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-muted);
}

/* TIME MACHINE SELECTOR */
.time-machine-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 20px;
}

.mode-toggle-group {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.mode-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mode-btn:hover {
  color: #fff;
}

.mode-btn.active {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #04121d;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.date-picker-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.9);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.date-picker-wrap label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ACTUAL RESULT BANNER */
.actual-result-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
  animation: fadeIn 0.3s ease;
}

.actual-banner-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}

.actual-badge {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.actual-hint {
  font-size: 11px;
  color: var(--text-dim);
}

.actual-summary-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

@media (max-width: 768px) {
  .actual-summary-row {
    grid-template-columns: 1fr 1fr;
  }
}

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

.actual-metric-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.actual-metric-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.actual-winners-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.actual-winners-title {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.actual-numbers-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.winner-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.winner-chip.chip-predicted {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--emerald);
  color: #34d399;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

/* HIT BADGES */
.hit-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}

.hit-badge-trung {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.hit-badge-nhay {
  background: rgba(245, 158, 11, 0.2);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

.hit-badge-miss {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
}

/* ACTUAL WINNER CELL IN 10X10 MATRIX */
.matrix-cell.actual-winner {
  border: 2px solid var(--emerald) !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.matrix-cell.actual-winner::after {
  content: '★';
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 8px;
  color: var(--amber);
}

/* SPOTLIGHT HERO CARDS */
.target-draw-label {
  font-size: 13px;
  color: var(--cyan);
}

.spotlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin-bottom: 24px;
  min-width: 0;
}

.spotlight-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.spotlight-card.bach-thu {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(15, 23, 42, 0.8));
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.15);
}

.spotlight-card.song-thu {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(15, 23, 42, 0.8));
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15);
}

.card-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 12px;
}

.bach-thu .card-badge {
  background: rgba(6, 182, 212, 0.2);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.song-thu .card-badge {
  background: rgba(139, 92, 246, 0.2);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.spotlight-number {
  font-family: var(--font-mono);
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 20px rgba(6, 182, 212, 0.6);
  margin-bottom: 14px;
}

.song-thu-pair {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 46px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 14px;
}

.pair-divider {
  color: var(--text-dim);
  font-size: 24px;
}

.spotlight-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.meta-label {
  color: var(--text-muted);
  white-space: nowrap;
}

.meta-value {
  font-family: var(--font-mono);
  font-weight: 700;
  white-space: nowrap;
}

.meta-value.highlight {
  color: var(--emerald);
}

.meta-value.highlight-cyan {
  color: var(--cyan);
}

.meta-value.edge {
  color: var(--amber);
}

.reasons-list {
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  line-height: 1.4;
}

/* TABLE */
.table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.table-container::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.table-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: var(--cyan);
}

.table-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.styled-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.styled-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.styled-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.rank-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
}

.rank-1 {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.4));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.rank-2-3 {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(99, 102, 241, 0.35));
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.5);
}

.rank-4-5 {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(16, 185, 129, 0.25));
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.rank-default {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.row-top1 {
  background: rgba(245, 158, 11, 0.06) !important;
}

.row-top3 {
  background: rgba(139, 92, 246, 0.04) !important;
}

.row-top5 {
  background: rgba(6, 182, 212, 0.03) !important;
}

.row-sub {
  opacity: 0.8;
}

.num-cell {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.prob-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--emerald);
}

.edge-cell {
  font-family: var(--font-mono);
  font-weight: 600;
}

.edge-positive { color: var(--amber); }
.edge-negative { color: var(--text-dim); }

/* 10X10 MATRIX HEATMAP */
.matrix-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-bar {
  width: 120px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #1e293b, var(--blue), var(--cyan), var(--amber), var(--rose));
}

.matrix-10x10 {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin-top: 16px;
}

.matrix-cell {
  aspect-ratio: 1;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.matrix-cell:hover {
  transform: translateY(-2px) scale(1.08);
  z-index: 10;
  border-color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.cell-num {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.cell-prob {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
}

/* INSPECTOR BOX */
.inspector-box {
  margin-top: 16px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  animation: fadeIn 0.2s ease;
}

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

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.inspector-title {
  font-size: 16px;
  font-weight: 700;
}

.inspect-target {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--cyan);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
}

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

/* BACKTEST PANEL */
.backtest-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.styled-select {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border: 1px solid rgba(6, 182, 212, 0.4) !important;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.styled-select:focus,
.styled-select:hover {
  border-color: var(--cyan) !important;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3) !important;
}

.styled-select option {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  padding: 8px 12px;
  font-size: 13px;
}

.styled-select option:checked {
  background-color: #1e293b !important;
  color: var(--cyan) !important;
  font-weight: 700;
}

.backtest-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .backtest-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.metric-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px;
  border-radius: var(--radius-md);
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

.metric-value.highlight { color: var(--emerald); }
.metric-value.highlight-cyan { color: var(--cyan); }
.metric-value.highlight-gold { color: var(--amber); }

.metric-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* PERFORMANCE CHART */
.chart-section {
  margin-top: 24px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 4px;
}

.chart-title-wrap h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.chart-toggle-group {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chart-filter-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-filter-btn:hover {
  color: #fff;
}

.chart-filter-btn.active {
  background: rgba(6, 182, 212, 0.25);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.chart-canvas-container {
  position: relative;
  width: 100%;
  height: 320px;
}

.chart-legend-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
}

.legend-note-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-pred { background-color: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.dot-actual { background-color: var(--amber); }
.dot-rolling { background-color: var(--emerald); box-shadow: 0 0 6px var(--emerald); }
.dot-baseline { background-color: var(--rose); }

/* DYNAMIC STRATEGY BANNER */
.strategy-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(234, 179, 8, 0.35);
  box-shadow: 0 8px 32px -4px rgba(234, 179, 8, 0.12);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.strategy-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--amber), var(--emerald));
}

.strategy-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
}

.strategy-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  background: rgba(234, 179, 8, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.4);
  border-radius: 999px;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.strategy-sentiment {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.strategy-kpis {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.strat-kpi {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
}

.strat-kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.strat-kpi-val {
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  margin-top: 2px;
  white-space: nowrap;
}

.strategy-advice-text {
  font-size: 13.5px;
  color: #e2e8f0;
  line-height: 1.6;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  border-left: 3px solid var(--cyan);
  margin-bottom: 14px;
}

.strategy-picks-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.strat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
}

.strat-pill .pill-num {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  background: rgba(6, 182, 212, 0.25);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.strat-pill .pill-points {
  font-weight: 700;
  color: #fbbf24;
}

.strat-pill .pill-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.tag-amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.tag-cyan { background: rgba(6, 182, 212, 0.2); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.4); }
.tag-emerald { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.tag-gold { background: linear-gradient(135deg, rgba(234, 179, 8, 0.3), rgba(245, 158, 11, 0.4)); color: #fde047; border: 1px solid rgba(234, 179, 8, 0.6); font-weight: 800; }
.tag-dim { background: rgba(100, 116, 139, 0.2); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }

/* NUOI KHUNG PANEL */
.nuoi-khung-panel {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.6), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(192, 132, 252, 0.35);
  box-shadow: 0 8px 32px -4px rgba(139, 92, 246, 0.15);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.khung-card-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: center;
  padding: 12px 0;
}

@media (max-width: 768px) {
  .khung-card-grid {
    grid-template-columns: 1fr;
  }
}

.khung-main-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(192, 132, 252, 0.25);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.khung-target-badge {
  font-size: 11px;
  font-weight: 800;
  color: #c084fc;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.khung-target-number {
  font-size: 48px;
  font-weight: 900;
  font-family: var(--font-mono);
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 0 20px rgba(192, 132, 252, 0.6);
}

.khung-status-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(192, 132, 252, 0.2);
  color: #e9d5ff;
  border: 1px solid rgba(192, 132, 252, 0.4);
  margin-top: 6px;
}

.khung-stats-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.khung-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13.5px;
}

.khung-stat-item .stat-lbl {
  color: var(--text-muted);
  white-space: nowrap;
}

.khung-stat-item .stat-val {
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.khung-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.khung-steps-bar {
  display: flex;
  gap: 8px;
  flex: 1;
}

.khung-step-node {
  flex: 1;
  padding: 6px 8px;
  text-align: center;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  background: rgba(30, 41, 59, 0.6);
  color: var(--text-dim);
}

.khung-step-node.active {
  background: rgba(192, 132, 252, 0.25);
  color: #fff;
  border-color: rgba(192, 132, 252, 0.8);
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.3);
}

.khung-step-node.completed {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.5);
}

.khung-advice-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  border-left: 3px solid #c084fc;
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.5;
  margin-top: 10px;
}

/* ============================================================
   APP NAVIGATION TABS (SHARED HEADER)
============================================================ */
.app-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  padding: 4px 6px;
  border-radius: 999px;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(59, 130, 246, 0.25));
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.45);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.2);
}

/* ============================================================
   HISTORY PAGE STYLES
============================================================ */
.history-main {
  padding-bottom: 60px;
}

.history-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.filter-panel {
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}

.filter-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-mode-toggles {
  display: flex;
  gap: 6px;
}

.filter-controls-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.quick-presets {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.preset-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-btn-group .btn.active {
  background: rgba(6, 182, 212, 0.25);
  border-color: rgba(6, 182, 212, 0.5);
  color: #38bdf8;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.input-btn-group {
  display: flex;
  gap: 6px;
}

.styled-input {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 7px 12px;
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
}

.styled-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}

.styled-input.num-input {
  width: 90px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
}

.active-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-top: 16px;
  font-size: 13.5px;
}

.filter-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-clear-filter {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.4);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-clear-filter:hover {
  background: rgba(244, 63, 94, 0.35);
  color: #fff;
}

/* ============================================================
   HISTORICAL DRAW CARD
============================================================ */
.draws-list-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.history-draw-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s, border-color 0.2s;
}

.history-draw-card:hover {
  border-color: rgba(6, 182, 212, 0.35);
}

.draw-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(30, 41, 59, 0.35);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 20px;
}

.draw-date-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-icon {
  font-size: 24px;
}

.draw-date-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.2px;
}

.station-badge {
  font-size: 12px;
  color: var(--cyan);
  font-weight: 600;
}

.draw-quick-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.badge-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

.badge-item.badge-de {
  background: rgba(234, 179, 8, 0.1);
  border-color: rgba(234, 179, 8, 0.35);
}

.badge-label {
  color: var(--text-muted);
}

.badge-val {
  font-family: var(--font-mono);
  font-weight: 800;
}

.badge-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.color-rose {
  color: var(--rose);
}

/* DRAW CARD BODY: SPLIT VIEW (PRIZES + HEAD-TAIL) */
.draw-card-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  padding: 20px;
}

@media (max-width: 992px) {
  .draw-card-body {
    grid-template-columns: 1fr;
  }
}

/* View Mode Toggles Effect */
.draws-list-container.mode-prizes .headtail-table-column {
  display: none;
}
.draws-list-container.mode-prizes .draw-card-body {
  grid-template-columns: 1fr;
}

.draws-list-container.mode-headtail .prize-table-column {
  display: none;
}
.draws-list-container.mode-headtail .draw-card-body {
  grid-template-columns: 1fr;
}

/* TRADITIONAL PRIZE TABLE */
.traditional-prize-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-family: var(--font-mono);
  background: rgba(15, 23, 42, 0.4);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.traditional-prize-table td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
}

.prize-name-col {
  width: 100px;
  font-weight: 700;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.7);
  white-space: nowrap;
}

.row-special {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.12), rgba(244, 63, 94, 0.12));
}

.special-digits {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  letter-spacing: 2px;
}

.last2-glow {
  color: #fde047;
  background: rgba(234, 179, 8, 0.25);
  border: 1px solid rgba(234, 179, 8, 0.5);
  padding: 2px 6px;
  border-radius: 4px;
  text-shadow: 0 0 16px rgba(234, 179, 8, 0.8);
}

.row-p1 .prize-num {
  font-size: 20px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 1px;
}

.prize-num {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
  display: inline-block;
  cursor: pointer;
  transition: all 0.15s;
}

.prize-num:hover {
  color: var(--cyan);
  transform: scale(1.08);
}

.num-p7 {
  font-size: 18px;
  font-weight: 800;
  color: #c084fc;
}

/* HEAD-TAIL TABLE */
.headtail-table-column {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.headtail-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.headtail-title-bar .sub-note {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: normal;
}

.headtail-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
}

.headtail-table th {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  padding: 5px 8px;
  font-size: 12px;
  font-family: var(--font-sans);
  color: var(--text-muted);
}

.headtail-table td {
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 5px 8px;
}

.head-col {
  text-align: center;
  font-weight: 900;
  font-size: 14px;
  color: var(--amber);
  background: rgba(15, 23, 42, 0.6);
}

.tails-col {
  line-height: 1.6;
}

.tail-num-chip {
  display: inline-block;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.tail-num-chip:hover {
  background: rgba(6, 182, 212, 0.25);
  border-color: var(--cyan);
  color: #fff;
  transform: scale(1.08);
}

.tail-num-chip.is-de {
  background: rgba(234, 179, 8, 0.25);
  border-color: rgba(234, 179, 8, 0.6);
  color: #fde047;
  font-weight: 900;
}

.badge-cam {
  font-size: 11px;
  color: var(--rose);
  font-weight: 700;
  font-style: italic;
  opacity: 0.85;
}

.nhay-count {
  font-size: 10px;
  color: #38bdf8;
  font-weight: 800;
  margin-left: 2px;
}

/* DRAW CARD FOOTER (27 LO CHIPS) */
.draw-card-footer {
  background: rgba(15, 23, 42, 0.5);
  border-top: 1px solid var(--border-subtle);
  padding: 12px 20px;
}

.chips-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.chips-hint {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: normal;
}

.lo-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lo-chip {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: rgba(30, 41, 59, 0.5);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s;
}

.lo-chip:hover {
  background: rgba(6, 182, 212, 0.25);
  border-color: var(--cyan);
  color: #fff;
  transform: scale(1.08);
}

.lo-chip.chip-de {
  background: rgba(234, 179, 8, 0.2);
  border-color: rgba(234, 179, 8, 0.55);
  color: #fde047;
  font-weight: 900;
}

.lo-chip.chip-multi {
  background: rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.5);
  color: #38bdf8;
}

.chip-nhay {
  font-size: 10.5px;
  opacity: 0.85;
  margin-left: 2px;
}

/* ============================================================
   PAGINATION & LOAD MORE
============================================================ */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: 16px;
}

.pagination-info {
  font-size: 13.5px;
  color: var(--text-muted);
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-indicator {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 0 8px;
  color: #fff;
}

.load-more-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

/* ============================================================
   NUMBER MODAL / INSPECTOR
============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.number-modal-card {
  background: #0f172a;
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 650px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: rgba(30, 41, 59, 0.4);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-number-badge {
  font-size: 32px;
  font-weight: 900;
  font-family: var(--font-mono);
  color: #fff;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(139, 92, 246, 0.3));
  border: 1px solid rgba(6, 182, 212, 0.5);
  padding: 4px 14px;
  border-radius: 8px;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.3);
}

.modal-title-wrap h3 {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 20px 24px;
}

.modal-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .modal-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.modal-kpi-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
}

.kpi-sub {
  font-size: 10px;
  color: var(--text-dim);
}

.modal-history-section .section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}

.hits-table-wrap {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.hits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.hits-table th {
  position: sticky;
  top: 0;
  background: rgba(30, 41, 59, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 12px;
  text-align: left;
  color: var(--text-muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.hits-table td {
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}

.empty-state, .loading-state, .error-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(6, 182, 212, 0.2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

/* ============================================================
   100 NUMBERS STATISTICS DASHBOARD
============================================================ */
.stats-main {
  padding-bottom: 60px;
}

.stats-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* TOP RANKINGS KPI CARDS */
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s, border-color 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-card.card-khan {
  border-left: 4px solid var(--rose);
}
.kpi-card.card-hot10 {
  border-left: 4px solid var(--amber);
}
.kpi-card.card-hot30 {
  border-left: 4px solid var(--cyan);
}
.kpi-card.card-streak {
  border-left: 4px solid var(--emerald);
}

.kpi-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.kpi-icon {
  font-size: 24px;
}

.kpi-titles h3 {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.kpi-titles p {
  font-size: 11.5px;
  color: var(--text-muted);
}

.kpi-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ranking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s;
}

.ranking-item:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.5);
  transform: translateX(3px);
}

.rank-idx {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.rank-idx.rank-1 {
  background: rgba(234, 179, 8, 0.25);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.5);
}
.rank-idx.rank-2 {
  background: rgba(192, 132, 252, 0.25);
  color: #c084fc;
}
.rank-idx.rank-3 {
  background: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
}

.rank-num {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 900;
  color: #fff;
}

.rank-stat {
  text-align: right;
  font-size: 12.5px;
}

.rank-sub {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-left: 3px;
}

.empty-streak-note {
  text-align: center;
  padding: 20px 10px;
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}

/* STATS TOOLBAR */
.stats-toolbar-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 24px;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.view-mode-group {
  display: flex;
  gap: 6px;
}

.toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-chip.active {
  background: rgba(6, 182, 212, 0.25);
  color: #38bdf8;
  border-color: rgba(6, 182, 212, 0.6);
}

.filter-chip.chip-hot.active {
  background: rgba(234, 179, 8, 0.25);
  color: #fde047;
  border-color: rgba(234, 179, 8, 0.6);
}

.filter-chip.chip-streak.active {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.6);
}

.filter-chip.chip-khan-high.active {
  background: rgba(244, 63, 94, 0.25);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.6);
}

.select-group {
  display: flex;
  gap: 6px;
}

.quick-search-wrap .styled-input {
  width: 170px;
}

.toolbar-sub-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.sort-hint {
  color: var(--text-muted);
}

/* STATS DATA TABLE */
.stats-table-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  margin-bottom: 24px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.stats-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: var(--font-sans);
}

.stats-data-table th {
  background: rgba(30, 41, 59, 0.6);
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  text-align: left;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}

.sortable-th:hover {
  background: rgba(6, 182, 212, 0.15);
  color: #fff;
}

.sortable-th.active-sort {
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.1);
  border-bottom: 2px solid var(--cyan);
}

.sort-icon {
  margin-left: 4px;
  font-size: 11px;
  opacity: 0.8;
}

.stats-data-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.03);
  padding: 8px 14px;
  vertical-align: middle;
  white-space: nowrap;
}

.stats-data-table tr:hover {
  background: rgba(30, 41, 59, 0.4);
}

.table-num-btn {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 900;
  color: #fff;
  background: rgba(6, 182, 212, 0.18);
  border: 1px solid rgba(6, 182, 212, 0.4);
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.table-num-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
  color: var(--cyan);
}

.khan-cell-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.khan-val-text {
  font-size: 13px;
  font-family: var(--font-mono);
}

.khan-progress-track {
  height: 5px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.khan-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s;
}

.metric-highlight {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #fff;
}

.sub-nhay {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 3px;
}

.badge-streak {
  display: inline-block;
  font-weight: 800;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
  font-family: var(--font-mono);
}

.dim-stat {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 12.5px;
}

.date-stat {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* 10X10 HEATMAP GRID */
.stats-grid-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.grid-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.grid-metric-switch {
  display: flex;
  align-items: center;
  gap: 10px;
}

.metric-switch-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.grid-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-dim);
}

.legend-bar-gradient {
  width: 100px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, rgba(56, 189, 248, 0.4), rgba(245, 158, 11, 0.7), rgba(244, 63, 94, 0.9));
}

.matrix-10x10-stats {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
}

@media (max-width: 768px) {
  .matrix-10x10-stats {
    grid-template-columns: repeat(5, 1fr);
  }
}

.matrix-cell-stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.matrix-cell-stats:hover {
  transform: scale(1.1);
  z-index: 10;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.4);
}

.cell-num {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.cell-metric-val {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.9;
}

/* FOOTER */
.app-footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--border-subtle);
}

/* ============================================================
   LOADING SPINNERS & SKELETON ANIMATIONS
============================================================ */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(6, 182, 212, 0.2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 14px auto;
}

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

.table-loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 10px;
}

.loading-pulse {
  display: inline-block;
  animation: pulse-opacity 1.2s ease-in-out infinite;
  color: var(--cyan);
}

@keyframes pulse-opacity {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.btn.is-loading {
  opacity: 0.85;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   COMPREHENSIVE MOBILE RESPONSIVE STYLES (≤ 768px & ≤ 480px)
============================================================ */

/* Base Mobile Elements Defaults (Desktop) */
.btn-toggle-controls {
  display: none;
}
.desktop-desc {
  display: block;
}
.mobile-only-desc {
  display: none;
}
.mobile-top5-cards {
  display: none;
}
.mobile-table-toggle-bar {
  display: none;
}
.mobile-scroll-hint {
  display: none;
}
.mobile-bottom-nav {
  display: none;
}
.table-wrapper-responsive {
  width: 100%;
  overflow-x: auto;
}

/* Global Mobile Fixes */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

@media (max-width: 768px) {
  /* Prevent iOS auto-zoom on input focus */
  input[type="text"],
  input[type="date"],
  select,
  .styled-input,
  .styled-select {
    font-size: 16px !important;
  }

  /* Safe area & body padding for bottom navigation bar */
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* FIXED MOBILE BOTTOM NAVIGATION BAR */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: rgba(10, 15, 29, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 9999;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.6);
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 10.5px;
    font-weight: 600;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
  }

  .mobile-nav-item:active {
    transform: scale(0.92);
  }

  .mobile-nav-icon {
    font-size: 18px;
    line-height: 1;
  }

  .mobile-nav-label {
    letter-spacing: 0.2px;
  }

  .mobile-nav-item.active {
    color: #38bdf8;
  }

  .mobile-nav-item.active .mobile-nav-icon {
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.7));
  }

  .mobile-nav-action {
    color: var(--text-muted);
  }

  /* 1. HEADER & APP NAVIGATION */
  .app-header {
    padding: 8px 12px;
  }

  .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .brand h1 {
    font-size: 17px;
    letter-spacing: -0.3px;
    white-space: nowrap;
  }

  .brand-badge {
    font-size: 8.5px;
    padding: 1px 4px;
    margin-bottom: 2px;
  }

  .subtitle {
    display: none !important;
  }

  .header-status {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .btn-live-sync {
    padding: 5px 9px;
    font-size: 11px;
    gap: 4px;
  }

  .status-pill {
    padding: 4px 8px;
    font-size: 10.5px;
    border-radius: 14px;
    white-space: nowrap;
  }

  .baseline-badge {
    display: none !important;
  }

  .app-header .app-nav {
    display: none !important; /* Top nav replaced by bottom bar on mobile */
  }

  /* 2. MAIN LAYOUT & PANELS */
  .app-main {
    padding: 0 10px;
    margin: 10px auto;
    gap: 12px;
  }

  .history-container,
  .stats-container {
    padding: 0 10px;
  }

  .panel {
    padding: 14px 12px;
    border-radius: 12px;
  }

  .panel-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .panel-header h2 {
    font-size: 15px;
  }

  .panel-desc {
    font-size: 11.5px;
    margin-bottom: 10px;
    line-height: 1.4;
  }

  .icon-wrap {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  /* CONTROL PANEL ACCORDION ON MOBILE */
  .btn-toggle-controls {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .btn-toggle-controls.is-active {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
  }

  .desktop-desc {
    display: none !important;
  }

  .mobile-only-desc {
    display: block !important;
  }

  .control-panel-content {
    display: none;
    margin-top: 10px;
    animation: fadeIn 0.25s ease-out;
  }

  .control-panel-content.expanded {
    display: block !important;
  }

  /* 3. TIME MACHINE & CONTROLS */
  .time-machine-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 10px;
  }

  .mode-toggle-group {
    width: 100%;
    display: flex;
  }

  .mode-btn {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    font-size: 11.5px;
  }

  .date-picker-wrap {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
  }

  .date-picker-wrap label {
    width: 100%;
    font-size: 12px;
  }

  .date-picker-wrap .styled-select {
    flex: 1;
    min-width: 140px;
  }

  .date-picker-wrap .btn {
    width: 100%;
    justify-content: center;
  }

  /* 4. ACTUAL RESULTS BANNER (HISTORICAL MODE) */
  .actual-summary-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .actual-metric-val {
    font-size: 14px;
  }

  .actual-financial-row {
    flex-direction: column;
    gap: 5px;
    font-size: 11.5px;
  }

  .actual-numbers-chips {
    gap: 4px;
  }

  .actual-numbers-chips .winner-chip {
    font-size: 11px;
    padding: 3px 6px;
  }

  /* 5. STRATEGY & SCIENTIFIC WARNING HERO */
  .regime-banner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 10px 12px !important;
  }

  .strategy-banner {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 14px;
  }

  .strategy-header {
    flex-direction: column;
    gap: 8px;
  }

  .strategy-sentiment {
    font-size: 14px;
    line-height: 1.35;
  }

  .strategy-kpis {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    width: 100%;
  }

  .strat-kpi {
    padding: 6px 8px;
  }

  .strat-kpi-val {
    font-size: 13.5px;
  }

  .strategy-advice-text {
    font-size: 11.5px;
    padding: 8px;
    line-height: 1.45;
  }

  /* 6. SPOTLIGHT HERO CARDS */
  .spotlights-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 14px;
  }

  .spotlight-card {
    padding: 14px;
    border-radius: 12px;
  }

  .spotlight-number {
    font-size: 46px;
    font-weight: 900;
    line-height: 1;
    margin: 8px 0;
    text-align: center;
  }

  .song-thu-pair {
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    margin: 8px 0;
    text-align: center;
    gap: 10px;
    justify-content: center;
  }

  .spotlight-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
  }

  .meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-size: 11px;
    gap: 2px;
  }

  .meta-label {
    font-size: 9.5px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.2px;
  }

  .meta-value {
    font-size: 12.5px;
    font-weight: 700;
  }

  .reasons-list {
    font-size: 11.5px;
  }

  /* MARKOWITZ PORTFOLIO SECTION */
  .portfolio-body {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .portfolio-chips-list {
    justify-content: center;
  }

  /* 7. PREDICTION RANKINGS TABLE & DEDICATED MOBILE CARDS */
  .table-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .table-header-bar .mode-toggle-group {
    width: 100%;
  }

  .mobile-top5-cards {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .mobile-table-toggle-bar {
    display: block !important;
    margin-bottom: 10px;
  }

  .btn-mobile-table-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .btn-mobile-table-toggle.is-active {
    background: rgba(15, 23, 42, 0.95);
    border-color: var(--cyan);
    color: #fff;
  }

  .table-wrapper-responsive {
    display: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .table-wrapper-responsive.show-on-mobile {
    display: block !important;
    animation: fadeIn 0.25s ease-out;
  }

  .mobile-scroll-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    font-size: 11px;
    color: var(--text-dim);
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .mobile-pick-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease;
  }

  .mobile-pick-card:active {
    transform: scale(0.99);
  }

  .mobile-pick-card.rank-1 {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(15, 23, 42, 0.85) 100%);
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.1);
  }

  .mobile-pick-card.rank-2-3 {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(15, 23, 42, 0.85) 100%);
    border-color: rgba(56, 189, 248, 0.35);
  }

  .mobile-pick-card.rank-4-5 {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(15, 23, 42, 0.85) 100%);
    border-color: rgba(139, 92, 246, 0.3);
  }

  .mobile-pick-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .mobile-pick-left {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-pick-num {
    font-size: 24px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 2px 10px;
    border-radius: 8px;
  }

  .mobile-pick-card.rank-1 .mobile-pick-num {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
  }

  .mobile-pick-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .mobile-pick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }

  .mobile-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .m-stat-lbl {
    font-size: 9.5px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.2px;
    margin-bottom: 2px;
  }

  .m-stat-val {
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
  }

  .mobile-pick-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .mobile-reason-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10.5px;
    color: var(--text-main);
    line-height: 1.35;
  }

  .styled-table {
    min-width: 660px;
    font-size: 11.5px;
  }

  .styled-table th,
  .styled-table td {
    padding: 6px 8px;
  }

  /* 8. 10x10 HEATMAP MATRIX */
  .matrix-panel {
    overflow: hidden;
  }

  .matrix-10x10 {
    min-width: 0 !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(10, 1fr) !important;
    gap: 2.5px !important;
    padding: 2px !important;
    overflow-x: hidden !important;
  }

  .matrix-cell {
    border-radius: 4px !important;
    min-height: unset !important;
    aspect-ratio: 1 !important;
    padding: 2px !important;
  }

  .cell-num {
    font-size: 11px !important;
    font-weight: 700 !important;
  }

  .cell-prob {
    font-size: 7.5px !important;
    line-height: 1 !important;
    opacity: 0.85;
  }

  .inspector-box {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-glow);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  }

  .inspector-content > div:first-child {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* 9. BACKTEST SIMULATOR & CHART */
  .backtest-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .backtest-controls .styled-select,
  .backtest-controls .btn {
    width: 100%;
    justify-content: center;
  }

  .backtest-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .metric-card {
    padding: 10px 12px;
  }

  .metric-value {
    font-size: 18px;
  }

  .metric-sub {
    font-size: 10.5px;
    line-height: 1.35;
  }

  .chart-section {
    padding: 12px 10px;
  }

  .chart-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .chart-header > div:last-child {
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .chart-toggle-group {
    width: 100%;
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
    padding-bottom: 2px;
  }

  .chart-toggle-group::-webkit-scrollbar {
    display: none;
  }

  .chart-filter-btn {
    flex-shrink: 0;
    padding: 5px 9px;
    font-size: 10.5px;
  }

  .chart-canvas-container {
    height: 250px;
  }

  .chart-legend-notes {
    gap: 6px 10px;
    font-size: 10.5px;
  }

  /* 10. HISTORY PAGE RESPONSIVENESS */
  .filter-panel {
    padding: 12px 10px;
  }

  .filter-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .view-mode-toggles {
    width: 100%;
    display: flex;
  }

  .view-mode-toggles .mode-btn {
    flex: 1;
    text-align: center;
    padding: 7px 4px;
    font-size: 11px;
  }

  .filter-controls-grid {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .preset-btn-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    width: 100%;
  }

  .preset-btn-group .btn {
    padding: 7px 6px;
    font-size: 11px;
    justify-content: center;
  }

  .filter-field {
    width: 100%;
  }

  .input-btn-group {
    width: 100%;
    display: flex;
  }

  .input-btn-group .styled-input {
    flex: 1;
  }

  .filter-reset-wrap .btn {
    width: 100%;
    justify-content: center;
  }

  .draw-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }

  .draw-quick-badges {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .draw-card-body {
    padding: 8px 6px;
    gap: 12px;
  }

  .prize-table-column {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 6px;
  }

  .traditional-prize-table {
    min-width: 290px;
    font-size: 11.5px;
  }

  .traditional-prize-table td {
    padding: 5px 3px;
  }

  .prize-name-col {
    width: 48px;
    font-size: 10px;
    padding: 4px;
  }

  .special-digits {
    font-size: 18px;
    letter-spacing: 0.5px;
  }

  .row-p1 .prize-num {
    font-size: 14px;
  }

  .prize-num {
    font-size: 12px;
  }

  .num-p7 {
    font-size: 13px;
  }

  .headtail-table-column {
    padding: 8px 6px;
  }

  .headtail-table {
    font-size: 11.5px;
  }

  .headtail-table th,
  .headtail-table td {
    padding: 4px 5px;
  }

  .pagination-bar {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
  }

  .pagination-buttons {
    width: 100%;
    justify-content: center;
  }

  /* 11. STATISTICS PAGE RESPONSIVENESS */
  .stats-kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .kpi-card {
    padding: 12px 10px;
  }

  .kpi-titles h3 {
    font-size: 13px;
  }

  .kpi-titles p {
    font-size: 10px;
  }

  .stats-toolbar-panel {
    padding: 12px 10px;
  }

  .toolbar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .view-mode-group {
    width: 100%;
    display: flex;
  }

  .view-mode-group .mode-btn {
    flex: 1;
    text-align: center;
    padding: 7px 4px;
    font-size: 11px;
  }

  .toolbar-controls {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }

  .filter-chips {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 5px;
    padding-bottom: 2px;
    width: 100%;
  }

  .filter-chips::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex-shrink: 0;
    padding: 5px 10px;
    font-size: 11px;
  }

  .select-group {
    width: 100%;
    display: flex;
    gap: 6px;
  }

  .select-group .styled-select {
    flex: 1;
  }

  .quick-search-wrap,
  .quick-search-wrap .styled-input {
    width: 100% !important;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    box-shadow: inset -6px 0 8px -4px rgba(0, 0, 0, 0.4);
  }

  .stats-data-table {
    min-width: 540px;
    font-size: 11.5px;
  }

  .stats-data-table th,
  .stats-data-table td {
    padding: 6px 8px;
  }

  .matrix-10x10-stats {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 4px !important;
  }

  .matrix-cell-stats {
    padding: 8px 2px !important;
  }

  .modal-overlay {
    padding: 8px;
  }

  .number-modal-card {
    max-height: 92vh;
    overflow-y: auto;
    width: 100%;
  }

  .modal-header {
    padding: 10px 14px;
  }

  .modal-number-badge {
    font-size: 22px;
    padding: 2px 8px;
  }

  .modal-body {
    padding: 12px 14px;
  }

  .modal-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* MARTINGALE SIMULATOR MOBILE FORM */
  .martingale-controls-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .martingale-controls-bar .control-item {
    min-width: 0 !important;
    flex: unset !important;
    width: 100% !important;
  }

  #btn-run-martingale {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    margin-top: 4px !important;
    height: 42px !important;
  }

  .martingale-kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
}

/* 12. EXTRA-SMALL MOBILE PHONES (≤ 480px) */
@media (max-width: 480px) {
  .app-header {
    padding: 6px 10px;
  }

  .brand h1 {
    font-size: 15px;
  }

  .brand-badge {
    font-size: 8px;
    padding: 1px 3px;
  }

  .panel {
    padding: 12px 8px;
  }

  .spotlight-number {
    font-size: 38px;
  }

  .song-thu-pair {
    font-size: 28px;
  }

  .matrix-10x10 {
    gap: 1.5px !important;
  }

  .cell-num {
    font-size: 10px !important;
  }

  .cell-prob {
    display: none !important;
  }

  .actual-summary-row {
    grid-template-columns: 1fr 1fr;
  }

  .strategy-sentiment {
    font-size: 13px;
  }

  .draw-quick-badges {
    grid-template-columns: 1fr;
  }

  .preset-btn-group {
    grid-template-columns: 1fr 1fr;
  }

  .stats-kpi-grid {
    grid-template-columns: 1fr !important;
  }

  .mobile-pick-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
}

/* ========================================================
   EXPANDING MARTINGALE STRATEGY SIMULATOR STYLES
   ======================================================== */
.martingale-backtest-card {
  position: relative;
  background: linear-gradient(180deg, rgba(30, 27, 75, 0.25) 0%, rgba(15, 23, 42, 0.6) 100%);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.4s ease-out;
}

.martingale-controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 14px;
  min-width: 0;
}

.martingale-controls-bar .control-item {
  display: flex;
  flex-direction: column;
  flex: 1 1 180px;
  min-width: 160px;
}

.martingale-controls-bar .styled-select {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
}

.martingale-controls-bar .styled-select:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.btn-martingale-run,
#btn-run-martingale {
  margin-top: 0;
  padding: 8px 18px;
  font-size: 12.5px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #000;
  font-weight: 700;
  cursor: pointer;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap !important;
  flex-shrink: 0;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.btn-martingale-run:hover,
#btn-run-martingale:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.backtest-stats-grid,
.martingale-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 14px;
  margin-top: 16px;
  min-width: 0;
}

.martingale-steps-bar div {
  position: relative;
  cursor: pointer;
}

.martingale-steps-bar div:hover {
  filter: brightness(1.2);
}

.martingale-insights-box li {
  position: relative;
}

.martingale-table-wrapper .table-container::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.martingale-table-wrapper .table-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}

.martingale-table-wrapper .table-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.martingale-table-wrapper .table-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}







/* ========================================================
   GLOBAL UI NOWRAP & TEXT OVERFLOW OPTIMIZATIONS
   ======================================================== */
.no-wrap,
.nowrap,
.cell-nowrap {
  white-space: nowrap !important;
}

.allow-wrap {
  white-space: normal !important;
}

.styled-table td.allow-wrap {
  white-space: normal !important;
}

.badge,
.hit-badge,
.rank-badge,
.winner-chip,
.strat-pill-tag,
.badge-streak,
.badge-hot,
.badge-cold,
.badge-draw,
.card-badge,
.khung-status-pill {
  white-space: nowrap !important;
}

.martingale-controls-bar .control-item label {
  white-space: nowrap !important;
}

.martingale-controls-bar .styled-select {
  white-space: nowrap !important;
}

#btn-run-martingale {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

#bt-m-breakdown-legend div {
  white-space: nowrap !important;
}

.actual-financial-row > div {
  white-space: nowrap !important;
}

.portfolio-metrics-col span,
.portfolio-metrics-col strong {
  white-space: nowrap !important;
}

.spotlight-number,
.song-thu-pair {
  white-space: nowrap !important;
}


/* PORTFOLIO OPTIMIZATION SECTION */
.portfolio-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  align-items: center;
  min-width: 0;
}

@media (max-width: 1100px) {
  .portfolio-body {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ========================================================
   FEATURE SPLIT & NAVIGATION ENHANCEMENTS
   ======================================================== */

/* Desktop Header Nav (7 Items) */
.app-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 999px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

/* Quick Feature Cards Grid (Home Page) */
.quick-features-section {
  margin-top: 24px;
}

.quick-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.feature-nav-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.feature-nav-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.feature-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.feature-card-info h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.feature-card-info p {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

.feature-card-arrow {
  margin-left: auto;
  font-size: 16px;
  color: var(--text-dim);
  transition: transform 0.2s ease, color 0.2s ease;
}

.feature-nav-card:hover .feature-card-arrow {
  color: var(--cyan);
  transform: translateX(4px);
}

/* Mobile More Drawer Sheet */
.mobile-drawer-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mobile-drawer-overlay.active {
  display: flex !important;
  opacity: 1;
}

.mobile-drawer-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0a0f1d;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px 20px 0 0;
  padding: 16px 18px calc(24px + env(safe-area-inset-bottom, 0px)) 18px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  overflow-y: auto;
}

.mobile-drawer-overlay.active .mobile-drawer-sheet {
  transform: translateY(0);
}

.mobile-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-drawer-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.mobile-drawer-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-drawer-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.drawer-link-card:active {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  transform: scale(0.98);
}

.drawer-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.drawer-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer-card-info strong {
  font-size: 13.5px;
  color: #fff;
}

.drawer-card-info span {
  font-size: 11.5px;
  color: var(--text-dim);
}
