/* ─────────────────────────────────────────────────────────────────────────── */
/* Design Tokens                                                                */
/* ─────────────────────────────────────────────────────────────────────────── */

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg); 
}
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15); 
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.3); 
}

:root {
  /* Main Background - Deep rich dark theme */
  --bg:          #0c0d0f;
  /* Sidebar */
  --bg-sidebar:  rgba(12, 13, 15, 0.6);
  --bg-sidebar-hover: rgba(246, 193, 149, 0.15);
  --text-sidebar: #a89f98;
  
  /* Panels (Glassmorphism) */
  --bg-panel:    rgba(20, 21, 23, 0.6);
  --bg-panel2:   rgba(26, 27, 30, 0.5);
  
  /* Accents */
  --bg-row-buy:  rgba(16, 185, 129, 0.08);
  --bg-row-sell: rgba(239, 68, 68, 0.08);
  
  /* Borders */
  --border:      rgba(246, 193, 149, 0.12);
  --border-sidebar: rgba(246, 193, 149, 0.1);
  --border-buy:  rgba(16, 185, 129, 0.4);
  --border-sell: rgba(239, 68, 68, 0.4);

  /* Colors */
  --green:       #34d399;
  --green-dim:   rgba(52,211,153,0.15);
  --red:         #fb7185;
  --red-dim:     rgba(251,113,133,0.15);
  --amber:       #f6c195;
  --blue:        #ba8e6f;
  --blue-dim:    rgba(186,142,111,0.15);
  --muted:       #8b8078;
  
  /* Text */
  --text:        #fdfaf6;
  --text-dim:    #c4b8b1;

  --accent:      #f6c195;
  --accent-glow: rgba(246, 193, 149, 0.4);

  --radius:      16px;
  --radius-sm:   8px;
  --radius-md:   12px;
  --font:        'Inter', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', monospace;
  --transition:  0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --blur:        backdrop-filter: blur(12px);
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* Reset + Base                                                                 */
/* ─────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; }

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}
a { color: inherit; text-decoration: none; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* Layout & Sidebar                                                             */
/* ─────────────────────────────────────────────────────────────────────────── */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}
.sidebar-nav {
  width: 260px;
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  flex-shrink: 0;
  border-right: 1px solid var(--border-sidebar);
  position: relative;
}
.sidebar-brand {
  margin-bottom: 2.5rem;
  padding-left: 0.5rem;
}
.brand-name { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.5px; color: var(--text); }
.brand-accent { color: var(--accent); }

/* Mobile Sidebar Elements */
.mobile-header { display: none; }
.mobile-close-btn { display: none; }

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.nav-link {
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  font-weight: 500;
  color: var(--text-sidebar);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.nav-link:hover, .nav-link.active {
  background: var(--bg-sidebar-hover);
  color: var(--text);
}

/* Sidebar Tree View */
.nav-tree summary {
  list-style: none;
}
.nav-tree summary::-webkit-details-marker {
  display: none;
}
.nav-tree[open] .tree-chevron {
  transform: rotate(180deg);
}
.tree-chevron {
  transition: transform var(--transition);
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-width: 0;
}
.app-header {
  height: 70px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}


/* ─────────────────────────────────────────────────────────────────────────── */
/* Main Layout                                                                  */
/* ─────────────────────────────────────────────────────────────────────────── */
.main { flex: 1; max-width: 1600px; width: 100%; margin: 0 auto; padding: 2rem; }
.dashboard { display: flex; flex-direction: column; gap: 1.5rem; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* Stats Bar                                                                    */
/* ─────────────────────────────────────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.stat-card {
  background: var(--bg-panel);
  border-radius: var(--radius);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  padding: 0.75rem 1rem;
  display: flex; align-items: center; gap: 0.75rem;
  transition: transform var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.15); }
.stat-buy  { border-left: 4px solid var(--green); }
.stat-sell { border-left: 4px solid var(--red); }
.stat-icon { font-size: 1.4rem; text-shadow: 0 0 15px rgba(255,255,255,0.2); }
.stat-value { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--text-dim); margin-top: 2px; font-weight: 500; }
.stat-buy  .stat-value { color: var(--green); text-shadow: 0 0 10px var(--green-dim); }
.stat-sell .stat-value { color: var(--red); text-shadow: 0 0 10px var(--red-dim); }
.stat-model .stat-value { color: var(--blue); text-shadow: 0 0 10px var(--blue-dim); }

/* ─────────────────────────────────────────────────────────────────────────── */
/* Dashboard Grid                                                               */
/* ─────────────────────────────────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* Panels                                                                       */
/* ─────────────────────────────────────────────────────────────────────────── */
.panel {
  background: var(--bg-panel);
  border-radius: var(--radius);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
}
.panel-title { display: flex; align-items: center; gap: 0.75rem; }
.panel-title-text { font-weight: 700; font-size: 0.9rem; }
.run-badge {
  font-size: 0.7rem; font-family: var(--font-mono);
  background: var(--blue-dim); color: var(--blue);
  padding: 2px 8px; border-radius: 99px;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* Signals Table                                                                */
/* ─────────────────────────────────────────────────────────────────────────── */
.signals-meta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem; flex-wrap: wrap;
}
.signals-run-label { font-size: 0.75rem; color: var(--muted); }
.signal-summary-chips { display: flex; gap: 0.5rem; }
.chip {
  font-size: 0.7rem; font-weight: 600;
  padding: 3px 10px; border-radius: 99px;
  border: 1px solid var(--border);
}
.chip-buy  { background: var(--green-dim); color: var(--green); border-color: var(--border-buy); }
.chip-sell { background: var(--red-dim);   color: var(--red);   border-color: var(--border-sell); }
.chip-pass { background: rgba(0,0,0,0.04); color: var(--muted); }

.table-wrap { overflow-x: auto; }
.signals-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.82rem;
}
.signals-table thead th {
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.signals-table tbody tr.signal-row {
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.signals-table tbody tr.signal-row:hover { background: rgba(0,0,0,0.03); }
.buy-row  { background: var(--bg-row-buy); }
.sell-row { background: var(--bg-row-sell); }

.signals-table td { padding: 0.65rem 1rem; vertical-align: middle; }
.signals-table td.center { text-align: center; }
.ticker-tag {
  font-family: var(--font-mono); font-weight: 700; font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.signal-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
}
.signal-buy  { background: var(--green-dim); color: var(--green); border: 1px solid var(--border-buy); }
.signal-sell { background: var(--red-dim);   color: var(--red);   border: 1px solid var(--border-sell); }
.signal-pass { background: rgba(0,0,0,0.04); color: var(--muted); border: 1px solid var(--border); }

/* Prob bar */
.prob-bar-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem; min-width: 80px; width: 100%;
}
.prob-track {
  width: 100%; height: 4px; border-radius: 99px; background: rgba(0,0,0,0.1); overflow: hidden;
  position: relative;
}
.prob-bar {
  height: 100%; border-radius: 99px;
  position: absolute;
  transition: width 0.4s ease;
}
.signal-buy-bar { 
  background: var(--green); 
  left: 50%; 
  width: calc((var(--prob) - 0.5) * 100%); 
}
.signal-sell-bar { 
  background: var(--red); 
  right: 50%; 
  width: calc((0.5 - var(--prob)) * 100%); 
}
.signal-pass-bar { 
  background: var(--muted); 
  left: 50%; 
  transform: translateX(-50%); 
  width: 4px; 
}
.prob-label { font-size: 0.75rem; font-family: var(--font-mono); color: var(--text-dim); text-align: center; }

/* Tag */
.tag {
  display: inline-block;
  font-size: 0.68rem; padding: 2px 7px;
  background: rgba(0,0,0,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); white-space: nowrap;
}
.tag-sm { font-size: 0.62rem; }

/* Detail row */
.detail-row td { background: var(--bg-panel2); padding: 0; }
.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1px; background: var(--border); margin: 0;
}
.detail-item {
  background: var(--bg-panel2);
  padding: 0.75rem 1rem;
}
.detail-item-full { grid-column: 1 / -1; }
.detail-label { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.detail-val { font-size: 0.8rem; font-weight: 500; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* Sidebar & Columns                                                            */
/* ─────────────────────────────────────────────────────────────────────────── */
.main-column { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-bottom-cards { display: flex; flex-direction: column; gap: 1rem; }

/* Model Metrics */
.model-metrics { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; }
.metric-row { display: flex; justify-content: space-between; align-items: center; }
.metric-label { font-size: 0.78rem; color: var(--text-dim); }
.metric-value { font-size: 0.85rem; font-weight: 600; font-family: var(--font-mono); }
.metric-value.accent { color: var(--green); }
.metric-value.muted  { color: var(--muted); }
.divider { height: 1px; background: var(--border); margin: 0.25rem 0; }
.threshold-pill-row { display: flex; gap: 0.5rem; margin-top: 0.25rem; }
.threshold-pill {
  flex: 1; text-align: center; font-size: 0.7rem; font-weight: 700;
  font-family: var(--font-mono);
  padding: 5px 8px; border-radius: var(--radius-sm);
}
.sell-pill { background: var(--red-dim); color: var(--red); border: 1px solid var(--border-sell); }
.buy-pill  { background: var(--green-dim); color: var(--green); border: 1px solid var(--border-buy); }

/* Explainer */
.explainer-body { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.9rem; }
.zone-row { display: flex; gap: 0.75rem; align-items: flex-start; }
.zone-icon { font-size: 1rem; margin-top: 1px; flex-shrink: 0; }
.zone-name { font-size: 0.78rem; font-weight: 700; margin-bottom: 2px; }
.zone-desc { font-size: 0.7rem; color: var(--text-dim); line-height: 1.4; }

/* History */
.history-list { list-style: none; }
.history-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--transition);
}
.history-item:hover { background: rgba(0,0,0,0.03); }
.history-item:last-child { border-bottom: none; }
.history-date { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; flex-shrink: 0; }
.history-meta { font-size: 0.7rem; color: var(--muted); flex: 1; }
.history-arrow { color: var(--muted); font-size: 0.8rem; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* Buttons & Controls                                                           */
/* ─────────────────────────────────────────────────────────────────────────── */
.refresh-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(0,0,0,0.05);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 5px 12px; border-radius: var(--radius-sm);
  font-size: 0.78rem; font-family: var(--font); cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.refresh-btn:hover { background: rgba(0,0,0,0.09); color: var(--text); }

/* ─────────────────────────────────────────────────────────────────────────── */
/* Loading / Empty States                                                       */
/* ─────────────────────────────────────────────────────────────────────────── */
.loading-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.75rem; padding: 3rem 2rem; color: var(--muted);
}
.spinner-lg {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-sm {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 1rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* HTMX loading indicator spinner inline */
.spinner {
  display: none;
  width: 14px; height: 14px;
  border: 2px solid transparent;
  border-top-color: var(--text-dim);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.htmx-request .spinner { display: inline-block; }
.htmx-request.spinner  { display: inline-block; }

.empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.75rem; padding: 4rem 2rem; text-align: center;
}
.empty-icon  { font-size: 3rem; }
.empty-title { font-size: 1rem; font-weight: 700; }
.empty-desc  { font-size: 0.85rem; color: var(--muted); }
.empty-cmd {
  font-family: var(--font-mono); font-size: 0.75rem;
  background: var(--bg-panel2); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: var(--radius-sm);
  color: var(--green); display: block; margin-top: 0.5rem;
}
.empty-state-sm { padding: 1.5rem 1.25rem; font-size: 0.78rem; color: var(--muted); text-align: center; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* Utilities                                                                    */
/* ─────────────────────────────────────────────────────────────────────────── */
.font-mono  { font-family: var(--font-mono); }
.muted      { color: var(--muted); }
.accent     { color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 600; cursor: pointer; transition: all 0.2s ease;
  font-family: inherit; outline: none;
}
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.72rem; }
.btn-danger {
  background-color: var(--red-dim); color: var(--red); border-color: var(--border-sell);
}
.btn-danger:hover { background-color: var(--red); color: white; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* Footer                                                                       */
/* ─────────────────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1rem;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* Responsive                                                                   */
/* ─────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .app-container {
    flex-direction: column;
  }
  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-sidebar);
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  .hamburger-btn {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
  }
  .sidebar-nav {
    position: fixed;
    top: 0;
    left: -320px;
    width: 280px;
    height: 100vh;
    z-index: 2000;
    transition: left var(--transition), box-shadow var(--transition);
    background: #0c0d0f;
  }
  .sidebar-nav.active {
    left: 0;
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
  }
  .mobile-close-btn {
    display: block;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-sidebar);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 2001;
  }
  .sidebar-brand {
    padding-right: 2rem;
  }
  .app-header {
    display: none;
  }
  
  .stats-bar { 
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem;
    overflow-x: hidden;
    padding-bottom: 0.5rem;
  }
  .stats-bar .stat-card {
    min-width: 0;
    padding: 0.5rem 0.25rem;
    text-align: center;
    border-radius: var(--radius-sm);
  }
  .stat-card .stat-icon {
    font-size: 1rem;
    margin-right: 0;
    margin-bottom: 0.25rem;
  }
  .stat-card .stat-body {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .stat-card .stat-value {
    font-size: 0.8rem;
  }
  .stat-card .stat-label {
    font-size: 0.55rem;
    white-space: normal;
  }
  .dashboard-grid { 
    display: flex;
    flex-direction: column;
  }
  .sidebar { 
    display: contents;
  }
  #model-metrics-box {
    order: 2;
    width: 100%;
  }
  .main-column {
    order: 0;
    width: 100%;
  }
  .sidebar-bottom-cards {
    order: 1;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .sidebar-bottom-cards .panel {
    min-width: 0;
  }
  .sidebar-bottom-cards .panel-title-text {
    font-size: 0.75rem;
  }
  .sidebar-bottom-cards .zone-name {
    font-size: 0.65rem;
  }
  .sidebar-bottom-cards .zone-desc {
    display: none; /* Hide descriptions to save space */
  }
  .sidebar-bottom-cards .history-list {
    max-height: 200px;
  }
}
@media (max-width: 640px) {
  .main { padding: 1rem; }
  .header-inner { padding: 0 1rem; }
}

.mobile-view { display: none !important; }

/* Signals Table Mobile Layout */
@media (max-width: 1000px) {
    .desktop-view { display: none !important; }
    .mobile-view { display: block !important; padding: 16px 8px; }
}

.mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mc-card {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition), box-shadow var(--transition);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.mc-card:hover:not(.locked) {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    border-color: rgba(255, 255, 255, 0.15);
}

.mc-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; opacity: 0.9;
}
.mc-card.mc-buy::before { background: linear-gradient(90deg, transparent, #34d399, transparent); box-shadow: 0 2px 15px #34d399; }
.mc-card.mc-sell::before { background: linear-gradient(90deg, transparent, #fb7185, transparent); box-shadow: 0 2px 15px #fb7185; }
.mc-card.mc-pass::before { background: linear-gradient(90deg, transparent, var(--muted), transparent); box-shadow: 0 2px 15px var(--muted); }

.mc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0; }

.mc-ticker {
    font-size: 2rem; font-weight: 800; letter-spacing: -1px;
    color: var(--text); line-height: 1; margin-bottom: 4px;
}
.mc-ticker-sub { font-size: 0.75rem; color: var(--text-dim); font-family: var(--font-mono); }

.mc-badge {
    padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; font-weight: 700;
    display: flex; align-items: center; gap: 6px; letter-spacing: 0.5px;
}
.mc-badge.mc-buy { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.2); }
.mc-badge.mc-sell { background: rgba(239,68,68,0.15); color: #fb7185; border: 1px solid rgba(239,68,68,0.2); }
.mc-badge.mc-pass { background: rgba(0,0,0,0.04); color: var(--muted); border: 1px solid var(--border); }

.mc-prob { margin-bottom: 24px; }
.mc-prob-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-dim); margin-bottom: 8px; }
.mc-prob-track { height: 6px; background: var(--bg-panel2); border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.mc-prob-bar { height: 100%; border-radius: 6px; background: var(--muted); transition: width 0.4s ease; }
.mc-buy .mc-prob-bar { background: linear-gradient(90deg, #34d399, #34d399); box-shadow: 0 0 10px #34d399; }
.mc-sell .mc-prob-bar { background: linear-gradient(90deg, #fb7185, #fb7185); box-shadow: 0 0 10px #fb7185; }

.mc-targets { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 0; }
.mc-t-box {
    background: var(--bg-panel2); border: 1px solid var(--bg-panel2);
    border-radius: 12px; padding: 12px; display: flex; flex-direction: column; justify-content: center;
}
.mc-t-label { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; font-weight: 600; }
.mc-t-val { font-size: 1.5rem; font-weight: 700; font-family: var(--font-mono); }
.mc-t-box.pt .mc-t-val { color: #34d399; }
.mc-t-box.sl .mc-t-val { color: #fb7185; }

.mc-details { background: var(--bg-panel2); border-radius: 12px; padding: 16px; margin-bottom: 24px; border: 1px solid var(--bg-panel2); }
.mc-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mc-d-item { display: flex; flex-direction: column; gap: 4px; }
.mc-d-label { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; }
.mc-d-val { font-size: 0.85rem; color: var(--text); font-weight: 500; }

.mc-intraday { background: var(--bg-panel2); border-radius: 12px; padding: 16px; border: 1px solid var(--bg-panel2); }
.mc-i-title { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.mc-i-track { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.mc-i-track::-webkit-scrollbar { height: 4px; }
.mc-i-track::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.mc-node { flex: 0 0 auto; background: var(--bg-panel2); border-radius: 10px; padding: 12px; min-width: 100px; scroll-snap-align: start; border: 1px solid var(--bg-panel2); text-align: center; }
.mc-n-time { font-size: 0.65rem; color: var(--muted); font-family: var(--font-mono); }
.mc-n-prob { font-size: 1.1rem; font-weight: 700; font-family: var(--font-mono); margin: 6px 0; }
.mc-n-sum { font-size: 0.65rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; margin: 0 auto; }

.mc-intraday-inline {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}
.mc-d-list {
    display: flex;
    gap: 12px;
    margin-bottom: 0;
}
.mc-d-list .mc-d-item {
    flex: 1;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* Refactored Utility & Semantic Classes                                        */
/* ─────────────────────────────────────────────────────────────────────────── */

/* paper-trading-summary */
.paper-trading-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 16px 24px;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.pts-item { display: flex; flex-direction: column; gap: 4px; }
.pts-label { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.pts-val { font-weight: 800; font-family: var(--font-mono); font-size: 1.75rem; line-height: 1; }
.pts-val.positive { color: #34d399; text-shadow: 0 0 10px rgba(52, 211, 153, 0.3); }
.pts-val.negative { color: #fb7185; text-shadow: 0 0 10px rgba(248, 113, 113, 0.3); }
.pts-divider { width: 1px; height: 40px; background: rgba(255,255,255,0.1); display: none; }
@media (min-width: 600px) { .pts-divider { display: block; } }

/* Alert */
.alert {
  margin-bottom: 1rem;
  padding: 12px;
  border-radius: var(--radius-md);
}
.alert-warning {
  border-left: 4px solid #f6c195;
  background: rgba(245, 158, 11, 0.1);
  color: #f6c195;
}

/* Header Nav */
.header-nav {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-nav-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.header-nav-title h1 {
  margin: 0;
  font-size: 1.5rem;
}
.header-nav-back {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 1.5rem;
}
.btn-icon {
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 4px 12px;
  border: none;
  cursor: pointer;
}

/* Chart Container */
.chart-wrapper {
  margin-bottom: 1.5rem;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-panel2);
  padding: 12px;
}

/* Signal Grid Unified */
.signals-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.mc-card.locked {
  opacity: 0.6;
  filter: grayscale(100%);
  cursor: not-allowed;
}
.sc-free-star {
  color: #f6c195;
  font-size: 1rem;
}
.mc-badge-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.mc-body-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.mc-prob-val {
  font-family: var(--font-mono);
  font-weight: bold;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 4px;
}
.mc-t-box.right-align {
  text-align: right;
}
.sc-tgt {
  font-size: 0.85rem;
  font-family: var(--font-mono);
}
.sc-tgt.pt-val { color: #34d399; margin-bottom: 2px; }
.sc-tgt.sl-val { color: #fb7185; }
.sc-tgt.muted { color: var(--muted); margin-bottom: 2px; }

/* Responsive Unified Structure */
@media (min-width: 768px) {
  .signals-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  }
}
@media (min-width: 1200px) {
  .signals-list {
    grid-template-columns: 1fr;
  }
  .signals-list .mc-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .signals-list .mc-header { flex: 1 1 200px; }
  .signals-list .mc-body-grid { flex: 2 1 300px; margin-bottom: 0; }
  .signals-list .mc-intraday-inline { 
      flex: 3 1 400px; 
      border-top: none; 
      padding-top: 0; 
      border-left: 1px solid var(--border); 
      padding-left: 16px;
  }
}

/* Index dl elements */
.zone-title { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 4px; font-weight: bold; }
.zone-row { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.75rem; }
.zone-row:last-child { margin-bottom: 0; }
.color-green { color: #34d399; }
.color-red { color: #fb7185; }
.color-blue { color: #ba8e6f; }
.color-amber { color: #f6c195; }
.color-purple { color: #e8a87c; }

.sector-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
  background: rgba(56, 189, 248, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  display: inline-block;
}
.sector-link:hover {
  background: rgba(56, 189, 248, 0.2);
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* Strategy Toggle                                                              */
/* ─────────────────────────────────────────────────────────────────────────── */
.strategy-toggle-container {
  display: flex;
  margin-bottom: 1.5rem;
  justify-content: flex-start;
  align-items: center;
}
.strategy-toggle {
  display: inline-flex;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 4px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.strategy-toggle .toggle-btn {
  padding: 8px 20px;
  border-radius: 26px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
}
.strategy-toggle .toggle-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.05);
}
.strategy-toggle .toggle-btn:hover:not(.active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 600px) {
  .strategy-toggle-container {
    width: 100%;
    justify-content: center;
  }
  .strategy-toggle {
    width: auto;
    display: inline-flex;
    max-width: 100%;
  }
  .strategy-toggle .toggle-btn {
    text-align: center;
    padding: 6px 12px;
    font-size: 0.75rem;
    white-space: nowrap;
    flex: none;
  }
}
