/* ============================================
   MARKET STATUS PAGE — Page-specific styles
   Requires home.css loaded first for CSS vars,
   nav, footer, reveal, and button styles.
   ============================================ */

/* Hero (compact) */
.ms-hero {
  padding: 140px 0 60px;
  position: relative;
}

.ms-hero-inner {
  max-width: 680px;
}

.ms-hero .section-body {
  max-width: 580px;
}

#trade-status-section {
  padding-bottom: 0;
}

#trade-status-section .section-body {
  max-width: 100%;
  margin-bottom: 16px;
}

#lot-size-rules-section {
  padding-bottom: 0;
}

#lot-size-rules-section .section-body {
  max-width: 100%;
  margin-bottom: 16px;
}

#trend-alerts-section {
  padding-top: 0;
}

#trend-alerts-section .section-body {
  max-width: 100%;
  margin-bottom: 16px;
}

.section {
  padding: 60px 0;
}

.ms-hero + .section {
  padding: 0;
}

.ms-smc-link {
  color: var(--blue-light);
  text-decoration: underline;
  text-decoration-color: rgba(96, 165, 250, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition);
}

.ms-smc-link:hover {
  text-decoration-color: var(--blue-light);
}

/* ============================================
   CONTROLS
   ============================================ */
.mkt-controls {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.mkt-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mkt-filter {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 20px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all var(--transition);
}

.mkt-filter:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.mkt-filter.active {
  background: var(--blue-dim);
  border-color: rgba(96, 165, 250, 0.35);
  color: var(--blue-light);
}

/* Regime toggle buttons */
.mkt-regime-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mkt-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all var(--transition);
  opacity: 0.5;
}

.mkt-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-secondary);
  opacity: 0.8;
}

.mkt-toggle.active {
  opacity: 1;
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
}

.mkt-toggle .mkt-regime-pip {
  width: 6px;
  height: 6px;
}

/* Strength slider */
.mkt-strength-control {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.mkt-strength-control label {
  white-space: nowrap;
}

.mkt-strength-control input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.mkt-strength-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue-light);
  border: 2px solid rgba(96, 165, 250, 0.4);
  cursor: pointer;
}

.mkt-strength-control input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue-light);
  border: 2px solid rgba(96, 165, 250, 0.4);
  cursor: pointer;
}

#mkt-strength-value {
  min-width: 30px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  display: inline;
}

.mkt-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
  animation: mkt-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

.mkt-live-dot.stale {
  background: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

.mkt-live-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
  animation: none;
}

@keyframes mkt-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(0.8); }
}

/* ============================================
   REGIME PIPS & COUNTDOWN
   ============================================ */
.mkt-regime-pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mkt-countdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

#mkt-countdown-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.mkt-pip--bullish       { background: #34d399; box-shadow: 0 0 6px rgba(52, 211, 153, 0.5); }
.mkt-pip--bearish       { background: #f87171; box-shadow: 0 0 6px rgba(248, 113, 113, 0.5); }
.mkt-pip--ranging       { background: #60a5fa; box-shadow: 0 0 6px rgba(96, 165, 250, 0.5); }
.mkt-pip--transitioning { background: #fbbf24; box-shadow: 0 0 6px rgba(251, 191, 36, 0.5); }
.mkt-pip--contested     { background: #a78bfa; box-shadow: 0 0 6px rgba(167, 139, 250, 0.5); }

.mkt-cell-regime .mkt-regime-pip,
.mkt-card-tf .mkt-regime-pip {
  width: 6px;
  height: 6px;
}

.mkt-card-tf--empty .mkt-regime-pip {
  opacity: 0.3;
}

/* Pair column inner flex wrapper */
.mkt-pair-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Detail empty state */
.mkt-detail-empty {
  color: var(--text-muted);
}

/* Focus styles for interactive elements */
.mkt-filter:focus-visible,
.mkt-toggle:focus-visible,
.mkt-row:focus-visible {
  outline: 2px solid var(--blue-light);
  outline-offset: 2px;
}

/* ============================================
   MATRIX TABLE
   ============================================ */
.mkt-grid {
  margin-bottom: 48px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mkt-matrix {
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 700px;
}

/* Header row */
.mkt-matrix-header {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border);
}

.mkt-pair-head {
  padding: 11px 16px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  position: sticky;
  left: 0;
  background: #11141c;
  z-index: 10;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.mkt-pair-head:hover {
  background: rgba(255, 255, 255, 0.03);
}

.mkt-tf-head {
  padding: 11px 0;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-light);
  letter-spacing: 0.07em;
  border-right: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.mkt-tf-head:hover {
  background: rgba(255, 255, 255, 0.03);
}

.mkt-tf-head:last-child {
  border-right: none;
}

.mkt-sort-arrow {
  opacity: 0;
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  transition: all 0.2s ease;
  color: var(--blue-light);
}

/* Body */
.mkt-matrix-body {
  display: contents;
}

/* Data row */
.mkt-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  position: relative;
  cursor: pointer;
}

.mkt-row:last-child {
  border-bottom: none;
}

.mkt-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.mkt-row.hidden {
  display: none;
}

/* Confluence highlighting */
.mkt-row.confluence-bullish {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.08) 0%, transparent 60%);
  box-shadow: inset 2px 0 0 rgba(16, 185, 129, 0.8);
}

.mkt-row.confluence-bearish {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.08) 0%, transparent 60%);
  box-shadow: inset 2px 0 0 rgba(239, 68, 68, 0.8);
}

.mkt-row.confluence-bullish:hover {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, transparent 80%);
}

.mkt-row.confluence-bearish:hover {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.15) 0%, transparent 80%);
}

/* Pair label column */
.mkt-pair-col {
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
  border-right: 1px solid var(--border);
  position: sticky;
  left: 0;
  background: var(--bg-card);
  z-index: 5;
}

.mkt-row:hover .mkt-pair-col {
  background: #181b23;
}

.mkt-row.confluence-bullish .mkt-pair-col { background: #131921; }
.mkt-row.confluence-bearish .mkt-pair-col { background: #1c151a; }

.mkt-pair-col .mkt-symbol {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.mkt-cat-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* Timeframe cell */
.mkt-cell {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  justify-content: center;
  border-right: 1px solid var(--border);
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.mkt-cell:last-child {
  border-right: none;
}

/* Cell background tints */
.mkt-cell--bullish              { background: rgba(16, 185, 129, 0.05); }
.mkt-cell--bearish              { background: rgba(239, 68, 68, 0.05); }
.mkt-cell--ranging              { background: rgba(59, 130, 246, 0.05); }
.mkt-cell--transitioning        { background: rgba(245, 158, 11, 0.05); }
.mkt-cell--transitioning-bullish { background: rgba(16, 185, 129, 0.04); }
.mkt-cell--transitioning-bearish { background: rgba(239, 68, 68, 0.04); }
.mkt-cell--empty                { background: transparent; }

/* Fade non-trending cells */
.mkt-cell--ranging,
.mkt-cell--empty {
  filter: opacity(0.5);
  transition: filter 0.3s ease;
}

.mkt-cell--ranging:hover,
.mkt-cell--empty:hover {
  filter: opacity(1);
}

/* Cell content */
.mkt-cell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.mkt-cell-regime {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.mkt-cell-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
}

.mkt-cell--bullish .mkt-cell-label              { color: #34d399; }
.mkt-cell--bearish .mkt-cell-label              { color: #f87171; }
.mkt-cell--ranging .mkt-cell-label              { color: var(--blue-light); }
.mkt-cell--transitioning .mkt-cell-label        { color: #fbbf24; }
.mkt-cell--transitioning-bullish .mkt-cell-label { color: #34d399; }
.mkt-cell--transitioning-bearish .mkt-cell-label { color: #f87171; }
.mkt-cell--empty .mkt-cell-label                { color: var(--text-muted); }

.mkt-cell-pct {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  opacity: 0.8;
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: right;
}

/* Strength bar */
.mkt-cell-bar {
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1px;
  overflow: hidden;
}

.mkt-cell-fill {
  height: 100%;
  border-radius: 1px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.mkt-fill--bullish              { background: linear-gradient(90deg, #059669, #34d399); }
.mkt-fill--bearish              { background: linear-gradient(90deg, #dc2626, #f87171); }
.mkt-fill--ranging              { background: linear-gradient(90deg, var(--blue), var(--blue-light)); }
.mkt-fill--transitioning        { background: linear-gradient(90deg, #d97706, #fbbf24); }
.mkt-fill--transitioning-bullish { background: linear-gradient(90deg, #059669, #34d399); }
.mkt-fill--transitioning-bearish { background: linear-gradient(90deg, #dc2626, #f87171); }
.mkt-fill--empty                { background: rgba(200, 215, 255, 0.15); }

/* ============================================
   DETAIL PANEL (Accordion per pair)
   ============================================ */
.mkt-detail {
  grid-column: 1 / -1;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

.mkt-detail.open {
  border-bottom: 1px solid var(--border-hover);
}

.mkt-detail-inner {
  padding: 24px 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
}

.mkt-detail-grid {
  gap: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.mkt-detail-tf {
  padding: 16px 20px;
  border-right: 1px solid var(--border);
}

.mkt-detail-tf:last-child {
  border-right: none;
}

.mkt-detail-tf-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.mkt-detail-tf-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.mkt-detail-tf-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mkt-detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mkt-detail-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.mkt-detail-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.mkt-detail-value.contested {
  color: #a78bfa;
}

.mkt-detail-value.stable {
  color: #34d399;
}

.mkt-detail-value.shifting {
  color: #fbbf24;
}

.mkt-detail-value.aligned {
  color: #34d399;
}

.mkt-detail-value.diverging {
  color: #f87171;
}

/* Expand indicator on pair col */
.mkt-expand-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  position: relative;
  opacity: 0.4;
  flex-shrink: 0;
  transition: opacity var(--transition), transform var(--transition);
}

.mkt-expand-icon::before,
.mkt-expand-icon::after {
  content: '';
  position: absolute;
  background: var(--text-primary);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.mkt-expand-icon::before { width: 10px; height: 1.5px; }
.mkt-expand-icon::after  { height: 10px; width: 1.5px; transition: opacity var(--transition), transform var(--transition); }

.mkt-row:hover .mkt-expand-icon { opacity: 1; }

.mkt-row.expanded .mkt-expand-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}

.mkt-row.expanded .mkt-expand-icon::before {
  background: var(--blue-light);
}

/* ============================================
   EMPTY & ERROR STATES
   ============================================ */
.mkt-empty,
.mkt-error {
  text-align: center;
  padding: 80px 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

.mkt-empty-title,
.mkt-error-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* ============================================
   SKELETON LOADER
   ============================================ */
.mkt-skeleton-matrix {
  grid-template-columns: 140px repeat(5, minmax(0, 1fr));
  border: none;
}

.skeleton-row {
  animation: skeleton-pulse 1.8s infinite ease-in-out;
}

@keyframes skeleton-pulse {
  0%   { opacity: 0.4; }
  50%  { opacity: 0.8; }
  100% { opacity: 0.4; }
}

.skel-text {
  height: 12px;
  background: var(--blue-dim);
  border-radius: 4px;
  margin-bottom: 6px;
}

.skel-text.short { width: 50%; height: 14px; }
.skel-text.tiny  { width: 30%; height: 10px; margin-bottom: 0; }

.skel-block {
  width: 100%;
  height: 24px;
  background: rgba(200, 215, 255, 0.05);
  border-radius: 4px;
}

.skel-tf {
  width: 24px;
  height: 12px;
  background: var(--blue-dim);
  border-radius: 4px;
  margin: 0 auto;
}

/* ============================================
   FOOTER NOTE
   ============================================ */
.mkt-footer {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  padding-top: 8px;
}

.mkt-footer p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  font-style: italic;
}

/* ============================================
   CARD LAYOUT (Mobile)
   ============================================ */
.mkt-cards {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.mkt-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.mkt-card.hidden { display: none; }

.mkt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  background: var(--bg-card);
  transition: background var(--transition);
}

.mkt-card-header:hover {
  background: var(--bg-card-hover);
}

.mkt-card-symbol {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.mkt-card-body {
  border-top: 1px solid var(--border);
}

.mkt-card-tf {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.mkt-card-tf:last-child {
  border-bottom: none;
}

.mkt-card-tf--empty {
  opacity: 0.4;
}

.mkt-card-tf-name {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--blue-light);
  width: 32px;
  flex-shrink: 0;
}

.mkt-card-tf-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: 80px;
  flex-shrink: 0;
}

.mkt-card-tf-label--bullish              { color: #34d399; }
.mkt-card-tf-label--bearish              { color: #f87171; }
.mkt-card-tf-label--ranging              { color: var(--blue-light); }
.mkt-card-tf-label--transitioning        { color: #fbbf24; }
.mkt-card-tf-label--transitioning-bullish { color: #34d399; }
.mkt-card-tf-label--transitioning-bearish { color: #f87171; }
.mkt-card-tf-label--empty               { color: var(--text-muted); }

.mkt-card-tf-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1.5px;
  overflow: hidden;
  min-width: 20px;
}

.mkt-card-tf-fill {
  height: 100%;
  border-radius: 1.5px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.mkt-card-tf-pct {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  opacity: 0.8;
  width: 32px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.mkt-card-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.015);
}

.mkt-card-detail.open {
  border-top: 1px solid var(--border);
}

.mkt-card-detail .mkt-detail-inner {
  padding: 16px;
}

.mkt-card-detail .mkt-detail-tf {
  border-right: none;
  padding: 12px 8px;
}

.mkt-card .mkt-expand-icon { opacity: 0.4; }
.mkt-card-header:hover .mkt-expand-icon { opacity: 1; }

.mkt-card.expanded .mkt-expand-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}

.mkt-card.expanded .mkt-expand-icon::before {
  background: var(--blue-light);
}

.mkt-card.confluence-bullish {
  border-left: 2px solid rgba(16, 185, 129, 0.8);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
}

.mkt-card.confluence-bearish {
  border-left: 2px solid rgba(239, 68, 68, 0.8);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.06) 0%, transparent 50%);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .mkt-grid > .mkt-matrix {
    display: none !important;
  }

  .mkt-cards {
    display: flex;
  }
}

@media (max-width: 768px) {
  .ms-hero {
    padding: 120px 0 40px;
  }


  .mkt-detail-inner {
    padding: 20px 24px;
    gap: 16px 32px;
  }

  .mkt-detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0;
  }

  .mkt-detail-tf {
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  .ms-hero {
    padding: 100px 0 32px;
  }

  .mkt-controls {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================
   TREND ALERTS
   ============================================ */
#trend-alerts-section {
  padding-top: 60px;
}

#trend-alerts-section .section-label {
  color: var(--blue-light);
}

.ta-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.ta-card-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.ta-form-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.ta-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ta-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

.ta-field .form-control,
.ta-field select {
  background: var(--bg-secondary, #121826);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 13px;
  min-width: 180px;
}

.ta-field select option {
  background: var(--bg-secondary, #121826);
  color: var(--text-primary);
}

.ta-option-separator {
  color: var(--text-secondary) !important;
  font-size: 0.85em;
  letter-spacing: 0.03em;
}

.ta-field .form-control:focus,
.ta-field select:focus {
  border-color: var(--blue-light);
  outline: none;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
}

.ta-field-btns {
  flex-direction: row;
  gap: 8px;
  align-items: flex-end;
}

.ta-btn {
  padding: 10px 22px;
  font-size: 13px;
  background: transparent;
  cursor: pointer;
}

.ta-btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  background: transparent;
  cursor: pointer;
}

.ta-btn-pause {
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}

.ta-btn-pause:hover {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.ta-btn-danger {
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.ta-btn-danger:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.ta-optional {
  opacity: 0.5;
  font-weight: 400;
}

.ta-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 600;
  font-style: italic;
  font-family: Georgia, serif;
  cursor: help;
  position: relative;
  margin-left: 6px;
  vertical-align: middle;
  transition: background var(--transition), color var(--transition);
}

.ta-filter-row > .ta-info {
  margin-left: -2px;
  margin-right: 4px;
}

.ta-info:hover {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.7);
}

.ta-info .ta-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 400;
  font-style: normal;
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  color: #e2e8f0;
  white-space: normal;
  width: 240px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 100;
  pointer-events: none;
}

.ta-info:hover .ta-tooltip {
  display: block;
}

[data-ta-tooltip] {
  position: relative;
}

[data-ta-tooltip]::after {
  content: attr(data-ta-tooltip);
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  color: #e2e8f0;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  z-index: 100;
  pointer-events: none;
}

[data-ta-tooltip]:hover::after {
  display: block;
}

.ta-submit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.ta-status {
  font-size: 13px;
  margin-top: 10px;
  min-height: 20px;
}

.ta-status--success { color: #10b981; }
.ta-status--error { color: #ef4444; }
.ta-status--info { color: var(--text-muted); }

/* Alert Cards */
.ta-alert-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#ta-alerts-list .ta-alert-card {
  border: 1px solid rgba(255, 255, 255, 0.18);
}

[data-bs-theme=light] #ta-alerts-list .ta-alert-card {
  border-color: rgba(0, 0, 0, 0.15);
}

.ta-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ta-alert-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.ta-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

.ta-badge--active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.ta-badge--triggered {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

.ta-badge--inactive {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.ta-alert-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ta-filter-badge {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.ta-alert-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.ta-alert-actions {
  display: flex;
  gap: 8px;
}

/* ── Conditions Section (card display) ───────────────────── */

.ta-cond-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ta-cond-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.ta-cond-card-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.ta-cond-card-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
  min-width: 140px;
}

.ta-cond-card-tf {
  font-weight: 600;
  color: var(--text-primary);
}

.ta-cond-card-dir {
  color: var(--text-secondary);
  font-size: 12px;
}

.ta-cond-card-symbols {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  line-height: 1.6;
  padding: 4px 0;
}

.ta-cond-card-separator {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  padding: 2px 0;
}

/* ── Alert Info Bar ──────────────────────────────────────── */

.ta-alert-infobar {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding: 10px 0 0;
}

.ta-infobar-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
}

.ta-infobar-item:first-child {
  padding-left: 0;
}

.ta-infobar-item:not(:last-child) {
  border-right: 1px solid var(--border);
}

.ta-infobar-item svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.ta-infobar-never {
  color: #f59e0b;
  font-weight: 500;
}

/* ── Full-Width Action Buttons ───────────────────────────── */

.ta-alert-actions--full {
  display: flex;
  gap: 8px;
}

.ta-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.ta-action-btn svg {
  flex-shrink: 0;
}

.ta-action-btn--edit,
.ta-action-btn--block {
  background: rgba(255, 255, 255, 0.04);
}

.ta-action-btn--edit:hover,
.ta-action-btn--block:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--blue-light);
}

.ta-action-btn--pause {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.ta-action-btn--pause:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
}

.ta-action-btn--delete {
  background: rgba(127, 29, 29, 0.5);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.ta-action-btn--delete:hover {
  background: rgba(127, 29, 29, 0.7);
  border-color: #ef4444;
  color: #fecaca;
}

/* Filter Rows */
.ta-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.ta-filter-row select,
.ta-filter-row .form-control {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  min-width: 140px;
  appearance: auto;
}

.ta-filter-row select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.ta-filter-row .form-control:focus,
.ta-filter-row select:focus {
  border-color: var(--blue-light);
  outline: none;
}

/* Multi-select symbol dropdown */
.ta-multiselect {
  position: relative;
  min-width: 140px;
}

.ta-multiselect-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--bg-body, #0a0e1a);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary, #f0f4ff);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ta-multiselect-toggle:focus {
  border-color: var(--blue-light);
  outline: none;
}

.ta-multiselect-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1050;
  min-width: 180px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-card, #151c2d) !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  margin-top: 4px;
  padding: 6px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  color: #f0f4ff !important;
}

.ta-multiselect-dropdown.open {
  display: block;
}

.ta-multiselect-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 13px;
  color: #dce6ff !important;
  cursor: pointer;
  white-space: nowrap;
}

.ta-multiselect-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f0f4ff !important;
}

.ta-multiselect-item input[type="checkbox"] {
  accent-color: var(--blue-light);
  cursor: pointer;
}

.ta-multiselect-all {
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  padding-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.ta-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}

.ta-filter-check input[type="checkbox"] {
  accent-color: var(--blue-light);
  cursor: pointer;
  margin: 0;
}

.ta-filter-check:has(input:checked) span {
  color: var(--text-primary);
}

.ta-filter-flag {
  font-size: 10px;
  font-weight: 500;
  color: var(--blue-light);
  opacity: 0.8;
}

.ta-remove-filter {
  margin-left: 8px;
  padding: 4px 10px;
  line-height: 1;
  background: transparent;
  cursor: pointer;
}

.ta-add-filter-btn {
  background: transparent;
  border-color: rgba(96, 165, 250, 0.3);
  color: var(--blue-light);
}

.ta-add-filter-btn:hover {
  background: rgba(96, 165, 250, 0.08);
  border-color: var(--blue-light);
  color: var(--blue-light);
}

@media (max-width: 600px) {
  .ta-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ta-field .form-control {
    min-width: unset;
  }

  .ta-filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ta-filter-row .form-control {
    min-width: unset;
  }
}

/* ── Trading Hours ──────────────────────────────────────────── */

.ta-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.ta-th-toggle-row {
  margin-bottom: 12px;
}

.ta-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

.ta-toggle-label input[type="checkbox"] {
  cursor: pointer;
}

#ta-th-fields input[type="time"] {
  color-scheme: dark;
}

.ta-th-days {
  margin-top: 12px;
  margin-bottom: 0;
}

.ta-th-days > label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ta-th-day-checks {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.ta-th-day {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.ta-th-day:has(input:checked) {
  border-color: var(--blue-light);
  background: rgba(96, 165, 250, 0.08);
  color: var(--text-primary);
}

.ta-th-day input[type="checkbox"] {
  cursor: pointer;
}

/* ── Trade Blocks subsection ────────────────────────────────── */

.ta-subsection-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.ta-subsection-body {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.tb-block-badge {
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  color: var(--text-primary);
}

.tb-linked-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}

.tb-block-date {
  font-size: 12px;
  color: var(--text-muted);
}

.tb-empty {
  color: var(--text-muted);
  font-size: 14px;
}

.tb-block-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

/* ── Block button on triggered alerts ───────────────────────── */

.ta-field-grow {
  flex: 2;
}

.ta-btn-block {
  color: var(--blue-light);
  border-color: rgba(96, 165, 250, 0.3);
}

.tb-bulk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}

.tb-select-all-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.tb-select-all-label input[type="checkbox"] {
  accent-color: var(--blue-light);
  cursor: pointer;
}

.tb-block-check {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-right: 4px;
}

.tb-block-check input[type="checkbox"] {
  accent-color: var(--blue-light);
  cursor: pointer;
}

.ta-btn-block:hover {
  background: rgba(96, 165, 250, 0.1);
  border-color: var(--blue-light);
}

/* ── Per-Alert Badges ─────────────────────────────────────── */

.ta-alert-badges {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ta-badge--mode {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.ta-badge--public {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.ta-badge--private {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
}

.ta-filter-joiner {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.ta-alert-telegram-info {
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ── Inline Trade Blocks per Alert ────────────────────────── */

.ta-alert-blocks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.ta-alert-blocks > label {
  font-weight: 600;
  margin-right: 4px;
}

.ta-alert-block-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  color: var(--text-secondary);
}

.ta-block-pair {
  white-space: nowrap;
}

.ta-lot-multiplier {
  width: 120px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  text-align: center;
  transition: border-color 0.2s;
}

.ta-lot-multiplier:focus {
  outline: none;
  border-color: var(--accent, #6366f1);
}

.ta-lot-multiplier--saved {
  border-color: #22c55e;
}

.ta-lot-multiplier--error {
  border-color: #ef4444;
}

.ta-block-mode-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: -4px;
  min-width: 24px;
}

.ta-block-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.ta-block-remove:hover {
  color: #ef4444;
}

.ta-alert-add-block {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
}

/* ── Filter Mode & Regime Toggles ─────────────────────────── */

.ta-filter-mode-toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ta-radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

.ta-radio-label input[type="radio"] {
  cursor: pointer;
}

.ta-toggles-row {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.ta-form-card:has(#ta-alert-th-fields:not([style*="display: none"]):not([style*="display:none"])) .ta-toggles-row {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  padding-bottom: 0;
}

.ta-toggles-row > .ta-field {
  padding: 0 24px;
  border-right: 1px solid var(--border);
}

.ta-toggles-row > .ta-field:first-child {
  padding-left: 0;
}

.ta-toggles-row > .ta-field:last-child {
  border-right: none;
  padding-right: 0;
}

@media (max-width: 600px) {
  .ta-toggles-row {
    flex-direction: column;
    gap: 16px;
  }

  .ta-toggles-row > .ta-field {
    padding: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
  }

  .ta-toggles-row > .ta-field:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
}

.ta-alert-th-section {
  padding-top: 16px;
}

.ta-alert-th-section:has(#ta-alert-th-fields:not([style*="display: none"]):not([style*="display:none"])) {
  padding-bottom: 0;
  margin-bottom: 0;
}

#ta-alert-th-fields input[type="time"] {
  color-scheme: dark;
}

/* ── Light mode overrides ──────────────────────────────────── */

[data-bs-theme=light] {
  --bg-primary: #f0f2f5;
  --bg-secondary: #e4e7ec;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f7fa;
  --bg-body: #f8f9fa;
  --border: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(59, 130, 246, 0.35);
  --blue-light: #2563eb;
  --blue-dim: rgba(59, 130, 246, 0.08);
  --text-primary: #1a1d23;
  --text-secondary: rgba(30, 40, 60, 0.65);
  --text-muted: rgba(30, 40, 60, 0.4);
  --text-label: rgba(37, 99, 235, 0.85);
}

[data-bs-theme=light] .ms-hero,
[data-bs-theme=light] body {
  background: var(--bg-primary);
  color: var(--text-primary);
}

[data-bs-theme=light] .section-alt {
  background: var(--bg-secondary);
}

[data-bs-theme=light] #ta-alert-th-fields input[type="time"] {
  color-scheme: light;
}

[data-bs-theme=light] .ta-field select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Matrix & Controls */
[data-bs-theme=light] .mkt-filter:hover {
  background: rgba(0, 0, 0, 0.03);
}

[data-bs-theme=light] .mkt-toggle.active {
  background: rgba(0, 0, 0, 0.03);
}

[data-bs-theme=light] .mkt-matrix-header {
  background: rgba(0, 0, 0, 0.03);
}

[data-bs-theme=light] .mkt-pair-head {
  background: #eceef2;
}

[data-bs-theme=light] .mkt-pair-head:hover,
[data-bs-theme=light] .mkt-tf-head:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-bs-theme=light] .mkt-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

[data-bs-theme=light] .mkt-pair-col {
  background: #f0f2f5;
}

[data-bs-theme=light] .mkt-row:hover .mkt-pair-col {
  background: #e8eaef;
}

[data-bs-theme=light] .mkt-row.confluence-bullish .mkt-pair-col {
  background: rgba(16, 185, 129, 0.04);
}

[data-bs-theme=light] .mkt-row.confluence-bearish .mkt-pair-col {
  background: rgba(239, 68, 68, 0.04);
}

[data-bs-theme=light] .mkt-cell-bar {
  background: rgba(0, 0, 0, 0.06);
}

[data-bs-theme=light] .mkt-detail {
  background: rgba(0, 0, 0, 0.015);
}

/* Cards (mobile) */
[data-bs-theme=light] .mkt-card-header:hover {
  background: #f5f7fa;
}

[data-bs-theme=light] .mkt-card-tf-bar {
  background: rgba(0, 0, 0, 0.06);
}

[data-bs-theme=light] .mkt-card-detail {
  background: rgba(0, 0, 0, 0.015);
}

/* Skeleton */
[data-bs-theme=light] .skel-block {
  background: rgba(0, 0, 0, 0.05);
}

/* Strength bar */
[data-bs-theme=light] .mkt-strength-control input[type="range"] {
  background: rgba(0, 0, 0, 0.1);
}

/* Glow pips */
[data-bs-theme=light] .mkt-pip--bullish       { box-shadow: none; }
[data-bs-theme=light] .mkt-pip--bearish       { box-shadow: none; }
[data-bs-theme=light] .mkt-pip--ranging       { box-shadow: none; }
[data-bs-theme=light] .mkt-pip--transitioning { box-shadow: none; }
[data-bs-theme=light] .mkt-pip--contested     { box-shadow: none; }
[data-bs-theme=light] .mkt-live-dot           { box-shadow: none; background: #10b981; }
[data-bs-theme=light] .mkt-live-dot.stale     { box-shadow: none; background: #f59e0b; }
[data-bs-theme=light] .mkt-live-dot.offline   { background: #ef4444; }

/* Pip colors — slightly darker for light bg */
[data-bs-theme=light] .mkt-pip--bullish       { background: #10b981; }
[data-bs-theme=light] .mkt-pip--bearish       { background: #ef4444; }
[data-bs-theme=light] .mkt-pip--ranging       { background: #3b82f6; }
[data-bs-theme=light] .mkt-pip--transitioning { background: #f59e0b; }
[data-bs-theme=light] .mkt-pip--contested     { background: #8b5cf6; }

/* Regime label colors — darker for AA contrast on white */
[data-bs-theme=light] .mkt-cell--bullish .mkt-cell-label              { color: #059669; }
[data-bs-theme=light] .mkt-cell--bearish .mkt-cell-label              { color: #dc2626; }
[data-bs-theme=light] .mkt-cell--ranging .mkt-cell-label              { color: #2563eb; }
[data-bs-theme=light] .mkt-cell--transitioning .mkt-cell-label        { color: #b45309; }
[data-bs-theme=light] .mkt-cell--transitioning-bullish .mkt-cell-label { color: #059669; }
[data-bs-theme=light] .mkt-cell--transitioning-bearish .mkt-cell-label { color: #dc2626; }
[data-bs-theme=light] .mkt-cell--empty .mkt-cell-label                { color: rgba(30, 40, 60, 0.4); }

/* Cell background tints — slightly stronger for visibility on white */
[data-bs-theme=light] .mkt-cell--bullish              { background: rgba(16, 185, 129, 0.06); }
[data-bs-theme=light] .mkt-cell--bearish              { background: rgba(239, 68, 68, 0.06); }
[data-bs-theme=light] .mkt-cell--ranging              { background: rgba(59, 130, 246, 0.05); }
[data-bs-theme=light] .mkt-cell--transitioning        { background: rgba(245, 158, 11, 0.06); }
[data-bs-theme=light] .mkt-cell--transitioning-bullish { background: rgba(16, 185, 129, 0.05); }
[data-bs-theme=light] .mkt-cell--transitioning-bearish { background: rgba(239, 68, 68, 0.05); }

/* Confluence rows */
[data-bs-theme=light] .mkt-row.confluence-bullish {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.06) 0%, transparent 60%);
  box-shadow: inset 2px 0 0 rgba(16, 185, 129, 0.6);
}
[data-bs-theme=light] .mkt-row.confluence-bearish {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.06) 0%, transparent 60%);
  box-shadow: inset 2px 0 0 rgba(220, 38, 38, 0.6);
}
[data-bs-theme=light] .mkt-row.confluence-bullish:hover {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, transparent 80%);
}
[data-bs-theme=light] .mkt-row.confluence-bearish:hover {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.1) 0%, transparent 80%);
}

/* Card confluence (mobile) */
[data-bs-theme=light] .mkt-card.confluence-bullish {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
}
[data-bs-theme=light] .mkt-card.confluence-bearish {
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.05) 0%, transparent 50%);
}

/* Card regime labels (mobile) */
[data-bs-theme=light] .mkt-card-tf-label--bullish              { color: #059669; }
[data-bs-theme=light] .mkt-card-tf-label--bearish              { color: #dc2626; }
[data-bs-theme=light] .mkt-card-tf-label--ranging              { color: #2563eb; }
[data-bs-theme=light] .mkt-card-tf-label--transitioning        { color: #b45309; }
[data-bs-theme=light] .mkt-card-tf-label--transitioning-bullish { color: #059669; }
[data-bs-theme=light] .mkt-card-tf-label--transitioning-bearish { color: #dc2626; }

/* Detail value colors */
[data-bs-theme=light] .mkt-detail-value.contested { color: #7c3aed; }
[data-bs-theme=light] .mkt-detail-value.stable    { color: #059669; }
[data-bs-theme=light] .mkt-detail-value.shifting  { color: #b45309; }
[data-bs-theme=light] .mkt-detail-value.aligned   { color: #059669; }
[data-bs-theme=light] .mkt-detail-value.diverging { color: #dc2626; }

/* Fill empty state */
[data-bs-theme=light] .mkt-fill--empty { background: rgba(0, 0, 0, 0.08); }

/* SMC link */
[data-bs-theme=light] .ms-smc-link {
  color: #2563eb;
  text-decoration-color: rgba(37, 99, 235, 0.3);
}
[data-bs-theme=light] .ms-smc-link:hover { text-decoration-color: #2563eb; }

/* Skeleton loader */
[data-bs-theme=light] .skel-text { background: rgba(0, 0, 0, 0.08); }
[data-bs-theme=light] .skel-tf   { background: rgba(0, 0, 0, 0.06); }

/* Filter active state */
[data-bs-theme=light] .mkt-filter.active {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.35);
  color: #2563eb;
}

/* Sort arrow & expand icon */
[data-bs-theme=light] .mkt-sort-arrow { color: #2563eb; }
[data-bs-theme=light] .mkt-row.expanded .mkt-expand-icon::before { background: #2563eb; }
[data-bs-theme=light] .mkt-card.expanded .mkt-expand-icon::before { background: #2563eb; }

/* Tooltips */
[data-bs-theme=light] .ta-info {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.4);
}

[data-bs-theme=light] .ta-info:hover {
  background: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.65);
}

[data-bs-theme=light] .ta-info .ta-tooltip,
[data-bs-theme=light] [data-ta-tooltip]::after {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1d23;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Trend alerts cards */
[data-bs-theme=light] .ta-filter-badge {
  background: rgba(0, 0, 0, 0.04);
}

[data-bs-theme=light] .ta-alert-block-item {
  background: rgba(0, 0, 0, 0.04);
}

[data-bs-theme=light] .ta-lot-multiplier {
  background: rgba(0, 0, 0, 0.03);
}

[data-bs-theme=light] .ta-multiselect-dropdown {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  color: #1a1f36 !important;
}

[data-bs-theme=light] .ta-multiselect-item {
  color: #1a1f36 !important;
}

[data-bs-theme=light] .ta-multiselect-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #000000 !important;
}

/* Symbol constraints */
[data-bs-theme=light] .sc-constraint-item {
  background: rgba(0, 0, 0, 0.03);
}

/* Trade Status Summary */
[data-bs-theme=light] .tss-row {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-bs-theme=light] .tss-alert-name {
  color: rgba(0, 0, 0, 0.5);
}

[data-bs-theme=light] .tss-unlinked {
  color: rgba(0, 0, 0, 0.35);
}

/* Status badges — darker for light bg */
[data-bs-theme=light] .tss-status--blocked { background: rgba(220, 38, 38, 0.1); color: #dc2626; }
[data-bs-theme=light] .tss-status--allowed { background: rgba(37, 99, 235, 0.1); color: #2563eb; }
[data-bs-theme=light] .tss-status--scaled  { background: rgba(217, 119, 6, 0.1); color: #b45309; }
[data-bs-theme=light] .sc-status--blocked  { background: rgba(220, 38, 38, 0.1); color: #dc2626; }
[data-bs-theme=light] .sc-status--allowed  { background: rgba(22, 163, 74, 0.1); color: #16a34a; }

/* Badge colors */
[data-bs-theme=light] .ta-badge--aggressive { background: rgba(220, 38, 38, 0.1); color: #dc2626; }
[data-bs-theme=light] .ta-badge--passive    { background: rgba(37, 99, 235, 0.1); color: #2563eb; }

/* Rules explanation & summary */
[data-bs-theme=light] .ta-rules-explanation {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.2);
  color: #059669;
}
[data-bs-theme=light] .ta-summary-example {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.2);
  color: #059669;
}
[data-bs-theme=light] .ta-summary-check { color: #059669; }
[data-bs-theme=light] .ta-rules-badge { background: rgba(16, 185, 129, 0.1); color: #059669; }
[data-bs-theme=light] .ta-rules-info-banner {
  background: rgba(37, 99, 235, 0.05);
  border-color: rgba(37, 99, 235, 0.15);
  color: #2563eb;
}
[data-bs-theme=light] .ta-rules-step-info { color: #2563eb; }

/* Buttons */
[data-bs-theme=light] .ta-btn-pause { color: #b45309; border-color: rgba(180, 83, 9, 0.4); }
[data-bs-theme=light] .ta-btn-pause:hover { border-color: #b45309; background: rgba(180, 83, 9, 0.08); }
[data-bs-theme=light] .ta-btn-danger { color: #dc2626; border-color: rgba(220, 38, 38, 0.4); }
[data-bs-theme=light] .ta-btn-danger:hover { border-color: #dc2626; background: rgba(220, 38, 38, 0.08); color: #dc2626; }

/* Mode button glows — remove for light bg */
[data-bs-theme=light] .sc-mode-btn--active-aggressive { box-shadow: none; }
[data-bs-theme=light] .sc-mode-btn--active-passive    { box-shadow: none; }
[data-bs-theme=light] .sc-mode-btn--active-aggressive .sc-mode-icon--aggressive { box-shadow: none; }
[data-bs-theme=light] .sc-mode-btn--active-passive .sc-mode-icon--passive       { box-shadow: none; }

/* Section label */
[data-bs-theme=light] .section-label { color: #2563eb; }
[data-bs-theme=light] #trend-alerts-section .section-label { color: #2563eb; }

/* Nav & footer on this page */
[data-bs-theme=light] .nav.scrolled {
  background: rgba(240, 242, 247, 0.9);
}

[data-bs-theme=light] .footer-logo-img {
  filter: brightness(0.2);
}

[data-bs-theme=light] .nav-link {
  color: #4a5568;
}

[data-bs-theme=light] .nav-link:hover,
[data-bs-theme=light] .nav-link--active {
  color: #1a1f36;
}

[data-bs-theme=light] .nav-dropdown-menu {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

[data-bs-theme=light] .nav-dropdown-menu a {
  color: #4a5568;
}

[data-bs-theme=light] .nav-dropdown-menu a:hover {
  color: #1a1f36;
  background: rgba(59, 130, 246, 0.06);
}

/* ── Form card containers ──────────────────────────────────── */

.ta-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.ta-form-card .form-control {
  background-color: var(--bg-secondary, #121826);
  border-color: var(--border);
  color: var(--text-primary);
  font-size: 13px;
  padding: 6px 10px;
}

.ta-form-card .form-control:focus {
  background-color: var(--bg-secondary, #121826);
  border-color: var(--blue-light);
  color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
}

.ta-form-card .form-control::placeholder {
  color: var(--text-muted);
}

[data-bs-theme=light] .ta-form-card .form-control {
  background-color: #fff;
  border-color: var(--border);
  color: var(--text-primary);
}

[data-bs-theme=light] .ta-form-card .form-control:focus {
  background-color: #fff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.ta-form-card .btn-outline-secondary,
.ta-rules-card .btn-outline-secondary,
.ta-alert-actions .btn-outline-secondary {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background-color: rgba(255, 255, 255, 0.05);
}

.ta-form-card .btn-outline-secondary:hover,
.ta-rules-card .btn-outline-secondary:hover,
.ta-alert-actions .btn-outline-secondary:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--blue-light);
}

[data-bs-theme=light] .ta-form-card .btn-outline-secondary,
[data-bs-theme=light] .ta-rules-card .btn-outline-secondary,
[data-bs-theme=light] .ta-alert-actions .btn-outline-secondary {
  color: var(--text-primary);
  border-color: var(--border);
  background-color: rgba(0, 0, 0, 0.03);
}

[data-bs-theme=light] .ta-form-card .btn-outline-secondary:hover,
[data-bs-theme=light] .ta-rules-card .btn-outline-secondary:hover,
[data-bs-theme=light] .ta-alert-actions .btn-outline-secondary:hover {
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.07);
  border-color: var(--blue);
}

.ta-form-card input[type="radio"],
.ta-form-card input[type="checkbox"],
.ta-rules-card input[type="radio"],
.ta-rules-card input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-muted);
  background: transparent;
  cursor: pointer;
  vertical-align: middle;
  flex-shrink: 0;
}

.ta-form-card input[type="radio"],
.ta-rules-card input[type="radio"] {
  border-radius: 50%;
}

.ta-form-card input[type="checkbox"],
.ta-rules-card input[type="checkbox"] {
  border-radius: 3px;
}

.ta-form-card input[type="radio"]:checked,
.ta-rules-card input[type="radio"]:checked {
  border-color: var(--blue-light);
  background: var(--blue-light);
  box-shadow: inset 0 0 0 3px var(--bg-card);
}

.ta-form-card input[type="checkbox"]:checked,
.ta-rules-card input[type="checkbox"]:checked {
  border-color: var(--blue-light);
  background: var(--blue-light);
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.ta-toggles-row .ta-field > label:first-child {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.ta-radio-desc {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Alert Rules card ──────────────────────────────────────── */

.ta-rules-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.ta-rules-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.ta-rules-header .ta-card-title {
  margin-bottom: 0;
}

.ta-rules-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.ta-rules-explanation {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #10b981;
  line-height: 1.5;
}

.ta-rules-columns {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.ta-rules-step {
  flex: 1;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
}

.ta-rules-step--conditions {
  flex: 2.5;
}

.ta-rules-step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.ta-rules-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.ta-rules-step-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-heading);
}

.ta-rules-step-note {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
}

.ta-rules-step-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.5;
}

.ta-rules-step-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--blue-light);
}

.ta-rules-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 20px;
}

/* ── Condition rows (Step 2) ───────────────────────────────── */

.ta-condition-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
}

[data-bs-theme=light] .ta-condition-row {
  background: rgba(0, 0, 0, 0.02);
}

.ta-condition-row .form-select {
  font-size: 13px;
  padding: 6px 10px;
  background-color: var(--bg-secondary, #121826);
  color: var(--text-primary);
  border-color: var(--border);
}

.ta-condition-row .ta-timeframe-select {
  flex: 1.15 1 0;
}

.ta-condition-row .ta-direction-select {
  flex: 2.1 1 0;
}

.ta-condition-row .ta-stronger-label {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.ta-condition-row .ta-stronger-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--blue-light, #60a5fa);
  cursor: pointer;
}

.ta-condition-row .ta-retrace-input {
  flex: 0 0 80px;
  width: 80px;
  font-size: 13px;
  padding: 6px 8px;
  background-color: var(--bg-secondary, #121826);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}

.ta-condition-row .ta-retrace-input:focus {
  background-color: var(--bg-secondary, #121826);
  border-color: var(--blue-light);
  color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
}

.ta-condition-row .form-select:focus {
  background-color: var(--bg-secondary, #121826);
  border-color: var(--blue-light);
  color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
}

.ta-condition-row .form-select option {
  background-color: var(--bg-secondary, #121826);
  color: var(--text-primary);
}

.ta-condition-row .form-select option:disabled {
  color: var(--text-muted);
}

[data-bs-theme=light] .ta-condition-row .form-select {
  background-color: #fff;
  color: var(--text-primary);
}

[data-bs-theme=light] .ta-condition-row .form-select:focus {
  background-color: #fff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

[data-bs-theme=light] .ta-condition-row .form-select option {
  background-color: #fff;
  color: var(--text-primary);
}

[data-bs-theme=light] .ta-condition-row .ta-retrace-input {
  background-color: #fff;
  color: var(--text-primary);
}

[data-bs-theme=light] .ta-condition-row .ta-retrace-input:focus {
  background-color: #fff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.ta-condition-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 2px 6px;
  line-height: 1;
  transition: color var(--transition);
}

.ta-condition-remove:hover {
  color: #ef4444;
}

.ta-add-condition-btn {
  width: 100%;
  margin-top: 8px;
  text-align: center;
}

/* ── Summary panel (Step 3) ────────────────────────────────── */

.ta-summary-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}

.ta-summary-check {
  color: #10b981;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.ta-summary-label {
  color: var(--text-secondary);
  font-size: 12px;
}

.ta-summary-value {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 13px;
}

.ta-summary-conditions-list {
  list-style: disc;
  padding-left: 16px;
  margin-top: 4px;
  margin-bottom: 0;
}

.ta-summary-conditions-list li {
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 2px;
}

.ta-summary-example {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 8px;
  font-size: 12px;
  color: #10b981;
  line-height: 1.5;
}

.ta-summary-example-icon {
  margin-right: 6px;
}

.ta-summary-empty {
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}

/* ── Bottom info banner ────────────────────────────────────── */

.ta-rules-info-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(96, 165, 250, 0.06);
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 8px;
  font-size: 13px;
  color: var(--blue-light);
}

/* ── Submit row ────────────────────────────────────────────── */

.ta-submit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  gap: 12px;
}

/* ── Trade block mode badges ───────────────────────────────── */

.ta-badge--aggressive {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.ta-badge--passive {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

/* ── Responsive: Alert Rules ───────────────────────────────── */

@media (max-width: 900px) {
  .ta-rules-columns {
    flex-direction: column;
    gap: 16px;
  }

  .ta-rules-arrow {
    display: none;
  }

  .ta-rules-step {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .ta-condition-row {
    flex-wrap: wrap;
  }

  .ta-rules-card {
    padding: 16px;
  }

  .ta-form-card {
    padding: 16px;
  }

  .ta-card .ta-form-card,
  .ta-card .ta-rules-card {
    border: none;
    border-radius: 0;
    padding: 12px 0;
  }
}

/* ── Light theme: alert card redesign ────────────────────── */

[data-bs-theme=light] .ta-cond-card-detail {
  background: rgba(0, 0, 0, 0.03);
}

[data-bs-theme=light] .ta-action-btn--edit,
[data-bs-theme=light] .ta-action-btn--block {
  background: rgba(0, 0, 0, 0.03);
}

[data-bs-theme=light] .ta-action-btn--pause {
  background: rgba(245, 158, 11, 0.1);
}

[data-bs-theme=light] .ta-action-btn--delete {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
}

/* ── Collapsible Form ────────────────────────────────────── */

.ta-collapse-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ta-collapse-icon {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform 0.2s ease;
}

.ta-collapsed .ta-collapse-icon {
  transform: rotate(-90deg);
}

.ta-collapse-body {
  margin-top: 16px;
}

.ta-collapse-body > .ta-status:last-child:empty {
  display: none;
}

/* ── Trade Status Summary ────────────────────────────────── */

.tss-card {
  padding: 20px;
}

.tss-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tss-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.tss-row:last-child {
  border-bottom: none;
}

.tss-row .ta-block-pair {
  min-width: 120px;
}

.tss-status--blocked {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.tss-status--allowed {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

.tss-status--scaled {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.tss-alert-name {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}

.tss-unlinked {
  color: rgba(255, 255, 255, 0.35);
  font-size: 12px;
  font-style: italic;
}

/* ── Responsive: alert card redesign ─────────────────────── */

@media (max-width: 600px) {
  .ta-cond-card-row {
    flex-direction: column;
    gap: 6px;
  }

  .ta-alert-infobar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .ta-infobar-item {
    padding: 0;
  }

  .ta-infobar-item:not(:last-child) {
    border-right: none;
  }

  .ta-alert-actions--full {
    flex-wrap: wrap;
  }
}

/* ── Symbol Constraints & Trade Mode ──────────────────────────── */

.sc-mode-toggle {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sc-mode-buttons {
  display: flex;
  gap: 12px;
}

.sc-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sc-mode-btn:hover {
  border-color: var(--text-secondary, #94a3b8);
}

.sc-mode-btn--active-aggressive {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

.sc-mode-btn--active-passive {
  border-color: #60a5fa;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.sc-mode-icon {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-secondary, #94a3b8);
}

.sc-mode-btn--active-aggressive .sc-mode-icon--aggressive {
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

.sc-mode-btn--active-passive .sc-mode-icon--passive {
  background: #60a5fa;
  box-shadow: 0 0 6px #60a5fa;
}

.sc-mode-description {
  font-size: 14px;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.5;
  margin-top: 12px;
}

.sc-empty-state {
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted, #64748b);
}

.sc-constraints-card {
  margin-top: 16px;
}

.sc-constraints-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.sc-constraints-header .ta-card-title {
  margin: 0;
}

.sc-count {
  font-weight: 400;
  color: var(--text-muted, #64748b);
  font-size: 14px;
}

.sc-bulk-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sc-constraints-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sc-constraint-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 6px;
  padding: 8px 12px;
}

.sc-constraint-check {
  display: flex;
  align-items: center;
}

.sc-constraint-check input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.sc-constraint-pair {
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #e2e8f0);
}

.sc-constraint-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sc-status--blocked {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.sc-status--allowed {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.sc-constraint-remove {
  background: transparent;
  border: none;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s ease;
}

.sc-constraint-remove:hover {
  color: #ef4444;
}

@media (max-width: 640px) {
  .sc-mode-buttons {
    flex-direction: column;
  }

  .sc-mode-btn {
    padding: 12px 20px;
    font-size: 14px;
  }

  .sc-constraints-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .sc-constraints-grid {
    flex-direction: column;
  }

  .sc-constraint-item {
    width: 100%;
  }
}

/* ============================================
   TRADE MANAGEMENT ON ACCOUNT DASHBOARD
   Maps home.css variable names to theme.css tokens
   so trade management styles work on both layouts.
   ============================================ */

#trade-management-card {
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: var(--ntl-transition, 0.2s ease);
  --radius: var(--ntl-radius, 12px);
  --radius-sm: var(--ntl-radius-sm, 8px);
  --blue: var(--ntl-blue, #3b82f6);
  --blue-light: var(--ntl-blue-light, #60a5fa);
  --blue-dim: var(--ntl-blue-dim, rgba(59, 130, 246, 0.12));
  --bg-card: var(--bs-card-bg);
  --bg-secondary: var(--bs-secondary-bg);
  --bg-body: var(--bs-body-bg);
  --bg-card-hover: var(--ntl-bg-card-hover);
  --border: var(--bs-card-border-color);
  --border-hover: var(--ntl-border-hover);
  --text-primary: var(--bs-body-color);
  --text-secondary: var(--bs-secondary-color);
  --text-muted: var(--bs-tertiary-color);
}

#trade-management-card .nav-tabs {
  border-bottom-color: rgba(59, 130, 246, 0.12);
}

#trade-management-card .nav-tabs .nav-link {
  color: var(--bs-secondary-color);
  border-radius: var(--ntl-radius-sm, 8px) var(--ntl-radius-sm, 8px) 0 0;
}

#trade-management-card .nav-tabs .nav-link.active {
  background-color: var(--bs-card-bg);
  border-color: var(--bs-card-border-color) var(--bs-card-border-color) var(--bs-card-bg);
  color: var(--bs-body-color);
}

#trade-management-card .nav-tabs .nav-link:hover:not(.active) {
  border-color: transparent;
  color: var(--bs-body-color);
}

#trade-management-card #ta-alert-th-fields input[type="time"] {
  color-scheme: dark;
}

[data-bs-theme=light] #trade-management-card #ta-alert-th-fields input[type="time"] {
  color-scheme: light;
}

.tm-form-section {
  border-top: 1px solid var(--border, rgba(0,0,0,0.12));
  padding-top: 16px;
}

.tm-form-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.tm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.tm-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, rgba(30,40,60,0.65));
}

.tm-field-btn {
  min-width: auto;
}

@media (max-width: 600px) {
  .tm-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .tm-field {
    min-width: unset;
  }
}

/* ============================================
   ACCOUNT DASHBOARD
   ============================================ */

.dash {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 0 48px;
}

/* Header */
.dash-header {
  margin-bottom: 8px;
  text-align: center;
}

.dash-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 3px solid #3b82f6;
  display: inline-block;
}

/* Sections */
.dash-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

/* Grid layouts */
.dash-grid {
  display: grid;
  gap: 12px;
}

.dash-grid--2 {
  grid-template-columns: 1fr 1fr;
}

.dash-grid--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.dash-grid--primary {
  grid-template-columns: repeat(2, 1fr);
}

.dash-grid--auto {
  display: flex;
  flex-wrap: wrap;
}

.dash-grid--auto > * {
  flex: 1 1 calc(50% - 6px);
}

@media (min-width: 768px) {
  .dash-grid--auto > * {
    flex: 1 1 calc(33.333% - 8px);
  }
}

@media (min-width: 1100px) {
  .dash-grid--auto > * {
    flex: 1 1 calc(25% - 9px);
  }
}

/* ── Live stats strip ────────────────────────────────── */

.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.dash-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.04) 0%, var(--bs-card-bg) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  text-decoration: none;
  color: var(--bs-body-color);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dash-stat:hover {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.08);
  color: var(--bs-body-color);
  text-decoration: none;
}

.dash-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bs-secondary-color);
}

.dash-stat-value {
  font-size: 22px;
  font-weight: 700;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  line-height: 1.2;
}

.dash-stat-value--pos {
  color: #22c55e;
}

.dash-stat-value--neg {
  color: #ef4444;
}

.dash-stat-value--dd {
  color: #f59e0b;
}

.dash-stat-sub {
  font-size: 12px;
  color: var(--bs-tertiary-color);
}

@media (max-width: 600px) {
  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-stat {
    padding: 12px 8px;
  }

  .dash-stat-value {
    font-size: 18px;
  }
}

/* ── Card (navigation item) ─────────────────────────── */

.dash-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.04) 0%, var(--bs-card-bg) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  text-decoration: none;
  color: var(--bs-body-color);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  font-family: inherit;
  font-size: inherit;
  text-align: left;
  width: 100%;
}

.dash-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, var(--bs-card-bg) 100%);
  color: var(--bs-body-color);
  text-decoration: none;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.12);
}

/* Icon circle */
.dash-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  font-size: 18px;
  flex-shrink: 0;
}

/* Label (single-line text) */
.dash-card-label {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  min-width: 0;
}

/* Body (multi-line: title + description) */
.dash-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 15px;
  line-height: 1.4;
}

.dash-card-desc {
  font-size: 13px;
  color: var(--bs-secondary-color);
  font-weight: 400;
}

/* Chevron */
.dash-card-chevron {
  color: var(--bs-secondary-color);
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.dash-card:hover .dash-card-chevron {
  opacity: 1;
}

/* Rotate chevron for collapse triggers */
.dash-card-chevron--rotate {
  transition: opacity 0.2s, transform 0.25s ease;
}

[aria-expanded="true"] .dash-card-chevron--rotate {
  transform: rotate(180deg);
}

/* Inline action button inside a card */
.dash-card-action {
  flex-shrink: 0;
}

/* License key mono text */
.dash-license-key {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 12px;
  word-break: break-all;
}

/* ── Card variants ──────────────────────────────────── */

/* Primary: gradient blue background */
.dash-card--primary {
  background: linear-gradient(135deg, rgba(30, 64, 130, 0.7) 0%, rgba(37, 55, 100, 0.5) 100%);
  border-color: rgba(59, 130, 246, 0.35);
}

.dash-card--primary:hover {
  border-color: rgba(96, 165, 250, 0.6);
  background: linear-gradient(135deg, rgba(30, 64, 130, 0.85) 0%, rgba(37, 55, 100, 0.65) 100%);
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.15);
}

.dash-card--primary .dash-card-icon {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

/* Secondary: compact, subdued utility actions */
.dash-card--secondary {
  background: var(--bs-secondary-bg);
  border-color: rgba(255, 255, 255, 0.06);
  padding: 10px 16px;
  gap: 10px;
}

.dash-card--secondary:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.15);
}

.dash-card--secondary .dash-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--bs-secondary-color);
}

.dash-card--secondary .dash-card-label {
  font-size: 14px;
  font-weight: 500;
}

/* Accent: full blue gradient (download buttons) */
.dash-card--accent {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  border-color: rgba(96, 165, 250, 0.4);
  color: #fff;
}

.dash-card--accent:hover {
  color: #fff;
  border-color: rgba(96, 165, 250, 0.7);
  box-shadow: 0 4px 24px rgba(59, 130, 246, 0.3);
  filter: brightness(1.08);
}

.dash-card--accent .dash-card-icon {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.dash-card--accent .dash-card-chevron {
  color: rgba(255, 255, 255, 0.7);
}

/* Product card: non-clickable, static */
.dash-card--product {
  cursor: default;
}

.dash-card--product:hover {
  box-shadow: none;
}

/* Alert variant */
.dash-card--alert {
  border-color: rgba(245, 158, 11, 0.35);
}

.dash-card--alert .dash-card-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.dash-card--alert .dash-card-icon--warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

/* Install variant (collapsible) */
.dash-card--install {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.dash-card--install[aria-expanded="true"] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}

/* Install collapse body */
.dash-install-collapse {
  background: var(--bs-card-bg);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-top: none;
  border-radius: 0 0 12px 12px;
}

.dash-install-body {
  padding: 20px 24px 24px;
}

.dash-install-body p {
  margin-bottom: 16px;
  font-size: 15px;
  color: var(--bs-secondary-color);
}

.dash-install-body b {
  color: var(--bs-body-color);
}

/* Numbered steps with timeline */
.dash-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dash-steps li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  position: relative;
  font-size: 15px;
  line-height: 1.5;
  color: var(--bs-secondary-color);
}

.dash-steps li:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 44px;
  bottom: -2px;
  width: 2px;
  background: rgba(59, 130, 246, 0.2);
}

.dash-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* ── Panel (content container matching card style) ──── */

.dash-panel {
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  background: var(--bs-card-bg);
  overflow: hidden;
  margin-bottom: 60px;
}

.dash-panel-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(59, 130, 246, 0.12);
}

.dash-panel-body {
  padding: 20px;
}

/* ── Light mode overrides ────────────────────────────── */

[data-bs-theme=light] .dash-card {
  border-color: rgba(0, 0, 0, 0.1);
}

[data-bs-theme=light] .dash-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

[data-bs-theme=light] .dash-card--primary {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(99, 102, 241, 0.06) 100%);
  border-color: rgba(59, 130, 246, 0.2);
}

[data-bs-theme=light] .dash-card--primary:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14) 0%, rgba(99, 102, 241, 0.1) 100%);
  border-color: rgba(59, 130, 246, 0.4);
}

[data-bs-theme=light] .dash-card--accent {
  color: #fff;
}

[data-bs-theme=light] .dash-card--accent:hover {
  color: #fff;
}

[data-bs-theme=light] .dash-card--secondary {
  background: var(--bs-secondary-bg);
  border-color: rgba(0, 0, 0, 0.06);
}

[data-bs-theme=light] .dash-card--secondary:hover {
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-bs-theme=light] .dash-card--secondary .dash-card-icon {
  background: rgba(0, 0, 0, 0.05);
  color: var(--bs-secondary-color);
}

[data-bs-theme=light] .dash-card-icon {
  background: rgba(59, 130, 246, 0.1);
}

[data-bs-theme=light] .dash-install-collapse {
  border-color: rgba(0, 0, 0, 0.1);
}

[data-bs-theme=light] .dash-panel {
  border-color: rgba(0, 0, 0, 0.1);
}

[data-bs-theme=light] .dash-panel-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-bs-theme=light] .dash-stat {
  border-color: rgba(0, 0, 0, 0.1);
}

[data-bs-theme=light] .dash-stat:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

[data-bs-theme=light] .dash-step-num {
  background: rgba(59, 130, 246, 0.1);
}

[data-bs-theme=light] .dash-steps li:not(:last-child)::before {
  background: rgba(59, 130, 246, 0.15);
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 768px) {
  .dash-grid--3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .dash {
    padding: 16px 0 32px;
    gap: 10px;
  }

  .dash-title {
    font-size: 22px;
  }

  .dash-grid--2,
  .dash-grid--3 {
    grid-template-columns: 1fr;
  }

  .dash-grid--auto > * {
    flex: 0 0 100%;
  }

  .dash-card {
    padding: 14px 16px;
    gap: 12px;
  }

  .dash-card-icon {
    width: 38px;
    height: 38px;
    font-size: 16px;
    border-radius: 10px;
  }

  .dash-card-label {
    font-size: 15px;
  }

  .dash-card--secondary {
    flex-direction: column;
    text-align: center;
    padding: 14px 10px;
    gap: 6px;
  }

  .dash-card--secondary .dash-card-chevron {
    display: none;
  }

  .dash-card--secondary .dash-card-label {
    font-size: 12px;
  }

  .dash-grid--auto > .dash-card--secondary {
    flex: 1 0 calc(33.333% - 8px);
  }

  .dash-install-body {
    padding: 16px;
  }

  .dash-panel-body {
    padding: 16px;
  }
}
