/* ═══════════════════════════════════════════════════════════════════════════════
   CandleVision v1.3.0 — candlevision_v130.css
   Scoped to .cv-* classes so it cannot bleed into other pages.
   Loaded via {% block extra_head %} in templates/candlevision.html only.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── CSS custom properties (inherit from base theme where possible) ─────────── */
:root {
  --cv-accent:        #7c3aed;
  --cv-accent-hover:  #6d28d9;
  --cv-accent-light:  rgba(124, 58, 237, 0.12);
  --cv-success:       #10b981;
  --cv-danger:        #ef4444;
  --cv-warning:       #f59e0b;
  --cv-neutral:       #64748b;
  --cv-border:        var(--border-color, #2d3748);
  --cv-card-bg:       var(--card-bg, #1a1f2e);
  --cv-text:          var(--text-primary, #e2e8f0);
  --cv-text-muted:    var(--text-secondary, #94a3b8);
  --cv-header-h:      56px;
}

/* ── Page wrapper — fixes the black-band at the bottom ─────────────────────── */
.cv-page-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(var(--cv-header-h) + 16px) 16px 4rem;
  /* 4rem bottom padding kills the empty void before the footer */
}

/* ── Sticky header ──────────────────────────────────────────────────────────── */
.cv-sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--cv-header-h);
  background: var(--cv-card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--cv-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.cv-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cv-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cv-candle-icon { font-size: 1.4rem; }

.cv-title-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cv-text);
  letter-spacing: 0.02em;
}

/* Status dot */
.cv-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cv-neutral);
  flex-shrink: 0;
  transition: background 0.3s;
}
.cv-status-dot.live   { background: var(--cv-success); box-shadow: 0 0 6px var(--cv-success); }
.cv-status-dot.error  { background: var(--cv-danger); }
.cv-status-dot.paused { background: var(--cv-warning); }

.cv-status-label {
  font-size: 0.78rem;
  color: var(--cv-text-muted);
}

.cv-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cv-model-label {
  font-size: 0.82rem;
  color: var(--cv-text-muted);
  white-space: nowrap;
}

.cv-model-select {
  background: var(--cv-card-bg);
  color: var(--cv-text);
  border: 1px solid var(--cv-border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  min-width: 180px;
}
.cv-model-select:focus { outline: 2px solid var(--cv-accent); }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.cv-btn:active { transform: scale(0.97); }

.cv-btn-primary {
  background: var(--cv-accent);
  color: #fff;
}
.cv-btn-primary:hover { background: var(--cv-accent-hover); }

.cv-btn-secondary {
  background: transparent;
  color: var(--cv-text);
  border: 1px solid var(--cv-border);
}
.cv-btn-secondary:hover { background: var(--cv-accent-light); }

.cv-btn-ghost {
  background: transparent;
  color: var(--cv-text-muted);
  border: 1px solid var(--cv-border);
  padding: 5px 12px;
  font-size: 0.82rem;
}
.cv-btn-ghost:hover { color: var(--cv-text); }

/* ── 2-column main grid ─────────────────────────────────────────────────────── */
.cv-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .cv-main-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Collapsible sections (<details>) ───────────────────────────────────────── */
.cv-section {
  background: var(--cv-card-bg);
  border: 1px solid var(--cv-border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: auto;          /* 'auto' allows CSS resize handle to appear */
  resize: vertical;        /* user can drag bottom-right corner to resize */
  min-height: 60px;
}

.cv-section-full {
  width: 100%;
}

.cv-section-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cv-text);
  user-select: none;
  list-style: none;
}
.cv-section-summary::-webkit-details-marker { display: none; }
.cv-section-summary::before {
  content: "▶";
  font-size: 0.7rem;
  color: var(--cv-text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
details[open] > .cv-section-summary::before {
  transform: rotate(90deg);
}
.cv-section-summary:hover { background: var(--cv-accent-light); }

.cv-section-body {
  padding: 0 16px 16px;
}

/* ── Drop zone ──────────────────────────────────────────────────────────────── */
.cv-drop-zone {
  border: 2px dashed var(--cv-border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}
.cv-drop-zone:hover,
.cv-drop-zone.cv-drag-over {
  border-color: var(--cv-accent);
  background: var(--cv-accent-light);
}

.cv-drop-hint {
  color: var(--cv-text-muted);
  font-size: 0.88rem;
  margin: 0;
}

.cv-preview-img {
  max-width: 100%;
  max-height: 280px;
  border-radius: 6px;
  border: 1px solid var(--cv-border);
  object-fit: contain;
}

/* ── Vision controls ────────────────────────────────────────────────────────── */
.cv-vision-controls { margin-bottom: 14px; }

.cv-instrument-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.cv-instrument-row label {
  font-size: 0.82rem;
  color: var(--cv-text-muted);
  white-space: nowrap;
}

.cv-input {
  background: var(--cv-card-bg);
  color: var(--cv-text);
  border: 1px solid var(--cv-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.875rem;
  flex: 1;
  min-width: 80px;
}
.cv-input:focus { outline: 2px solid var(--cv-accent); }

.cv-input-sm { max-width: 120px; flex: none; }

.cv-select {
  background: var(--cv-card-bg);
  color: var(--cv-text);
  border: 1px solid var(--cv-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.875rem;
}

.cv-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Verdict panel ──────────────────────────────────────────────────────────── */
.cv-verdict-panel {
  background: rgba(124,58,237,0.06);
  border: 1px solid var(--cv-accent);
  border-radius: 8px;
  padding: 14px;
  margin-top: 14px;
}

.cv-verdict-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.cv-verdict-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--cv-text);
}

.cv-agreement-badge {
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}
.cv-agreement-badge.agree    { background: rgba(16,185,129,0.2); color: var(--cv-success); }
.cv-agreement-badge.disagree { background: rgba(239,68,68,0.2);  color: var(--cv-danger); }
.cv-agreement-badge.neutral  { background: rgba(100,116,139,0.2); color: var(--cv-neutral); }

.cv-cost-badge {
  font-size: 0.75rem;
  color: var(--cv-text-muted);
  margin-left: auto;
}

.cv-verdict-content {
  font-size: 0.875rem;
  color: var(--cv-text);
  line-height: 1.6;
}

/* ── Spinner ────────────────────────────────────────────────────────────────── */
.cv-spinner {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cv-text-muted);
  font-size: 0.9rem;
  padding: 12px 0;
}
.cv-spinner-icon { animation: cv-pulse 1.2s ease-in-out infinite; }
@keyframes cv-pulse { 0%,100% { opacity:1; } 50% { opacity:0.3; } }

/* ── Right column cards ─────────────────────────────────────────────────────── */
.cv-col-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cv-card {
  background: var(--cv-card-bg);
  border: 1px solid var(--cv-border);
  border-radius: 10px;
  overflow: auto;
  resize: vertical;
  min-height: 60px;
}

.cv-card-header {
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--cv-text);
  border-bottom: 1px solid var(--cv-border);
  background: rgba(255,255,255,0.02);
}

.cv-card-body { padding: 12px 14px; }

/* Stats rows */
.cv-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.875rem;
}
.cv-stats-label { color: var(--cv-text-muted); }
.cv-stats-value { font-weight: 600; color: var(--cv-text); }
.cv-stats-divider { height: 1px; background: var(--cv-border); margin: 8px 0; }
.cv-stats-subheader {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cv-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.cv-stats-period { font-weight: 400; font-size: 0.8rem; color: var(--cv-text-muted); }

/* Outcome form */
.cv-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.cv-form-row label {
  font-size: 0.82rem;
  color: var(--cv-text-muted);
  white-space: nowrap;
  min-width: 70px;
}

.cv-outcome-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cv-outcome-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--cv-border);
  background: transparent;
  color: var(--cv-text);
  transition: background 0.15s;
}
.cv-outcome-win:hover  { background: rgba(16,185,129,0.2); border-color: var(--cv-success); color: var(--cv-success); }
.cv-outcome-loss:hover { background: rgba(239,68,68,0.2);  border-color: var(--cv-danger);  color: var(--cv-danger); }
.cv-outcome-skip:hover { background: rgba(245,158,11,0.2); border-color: var(--cv-warning); color: var(--cv-warning); }

.cv-outcome-msg {
  font-size: 0.82rem;
  min-height: 1.2em;
  color: var(--cv-success);
}
.cv-outcome-msg.error { color: var(--cv-danger); }

/* ── Live Detections — 6-column CSS grid ────────────────────────────────────── */
.cv-det-row {
  display: grid;
  grid-template-columns: 70px 110px 1fr 60px 90px 70px;
  gap: 12px;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--cv-border);
  font-size: 0.85rem;
  color: var(--cv-text);
}
.cv-det-row:hover { background: var(--cv-accent-light); }

.cv-det-header {
  font-weight: 600;
  color: var(--cv-text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  background: var(--cv-card-bg);
  border-bottom: 2px solid var(--cv-border);
  z-index: 2;
}

.cv-feed-scroll {
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--cv-border) transparent;
}

/* Direction badges */
.cv-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cv-badge.bullish { background: rgba(16,185,129,0.15); color: var(--cv-success); }
.cv-badge.bearish { background: rgba(239,68,68,0.15);  color: var(--cv-danger); }
.cv-badge.neutral { background: rgba(100,116,139,0.15); color: var(--cv-neutral); }

/* Score colouring */
.cv-score { font-weight: 700; }
.cv-score.high   { color: var(--cv-success); }
.cv-score.medium { color: var(--cv-warning); }
.cv-score.low    { color: var(--cv-neutral); }

/* Count badge in summary */
.cv-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--cv-accent-light);
  color: var(--cv-accent);
  font-size: 0.78rem;
  font-weight: 700;
  margin-left: 4px;
}

/* ── Filter chips ───────────────────────────────────────────────────────────── */
.cv-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 0;
}

.cv-filter-select {
  background: var(--cv-card-bg);
  color: var(--cv-text);
  border: 1px solid var(--cv-border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.82rem;
}

.cv-filter-input {
  background: var(--cv-card-bg);
  color: var(--cv-text);
  border: 1px solid var(--cv-border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.82rem;
  width: 100px;
}

/* ── Chart canvas ───────────────────────────────────────────────────────────── */
.cv-chart-canvas {
  width: 100% !important;
  max-height: 260px;
}

/* ── Placeholder text ───────────────────────────────────────────────────────── */
.cv-placeholder {
  color: var(--cv-text-muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 20px 0;
}

/* ── Responsive tweaks ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .cv-det-row {
    grid-template-columns: 60px 80px 1fr 50px 70px 55px;
    gap: 6px;
    font-size: 0.78rem;
  }
  .cv-header-controls { gap: 6px; }
  .cv-model-select { min-width: 130px; }
}
/* ============================================================
   CandleVision v1.4.0 Phase 7 — candlevision_css_phase7.css.snippet
   Appended to static/css/candlevision_v130.css by apply_all_patches.sh
   ============================================================ */

/* ── Section layout ────────────────────────────────────────────────────── */
.cv-section {
  background: var(--cv-surface, #1e2530);
  border: 1px solid var(--cv-border, #2d3748);
  border-radius: .75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  overflow: auto;          /* required for CSS resize handle */
  resize: vertical;        /* user can drag bottom-right corner to resize */
  min-height: 60px;
}

.cv-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--cv-text-primary, #e2e8f0);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.cv-section-icon { font-size: 1.2rem; }

.cv-section-desc {
  color: var(--cv-text-muted, #94a3b8);
  font-size: .875rem;
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

/* ── Track A: Resolver ─────────────────────────────────────────────────── */
.cv-resolver-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cv-resolver-hint {
  font-size: .8rem;
  color: var(--cv-text-muted, #94a3b8);
}

.cv-stats-extended-pills {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.cv-stat-pill {
  font-size: .75rem;
  font-weight: 500;
  padding: .2rem .6rem;
  border-radius: 9999px;
}

.cv-stat-auto    { background: rgba(59,130,246,.2); color: #93c5fd; }
.cv-stat-manual  { background: rgba(168,85,247,.2); color: #d8b4fe; }
.cv-stat-pending { background: rgba(234,179,8,.2);  color: #fde047; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.cv-btn {
  padding: .5rem 1.25rem;
  border: none;
  border-radius: .5rem;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.cv-btn:disabled { opacity: .5; cursor: not-allowed; }
.cv-btn:not(:disabled):hover { opacity: .85; transform: translateY(-1px); }

.cv-btn-primary { background: var(--cv-accent, #3b82f6); color: #fff; }
.cv-btn-accent  { background: var(--cv-accent2, #8b5cf6); color: #fff; }

/* ── Tables ────────────────────────────────────────────────────────────── */
.cv-table-scroll { overflow-x: auto; }

.cv-pattern-stats-table,
.cv-detections-table,
.cv-consensus-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.cv-pattern-stats-table th,
.cv-detections-table th,
.cv-consensus-table th {
  text-align: left;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--cv-border, #2d3748);
  color: var(--cv-text-muted, #94a3b8);
  font-weight: 500;
  white-space: nowrap;
}

.cv-pattern-stats-table td,
.cv-detections-table td,
.cv-consensus-table td {
  padding: .45rem .75rem;
  border-bottom: 1px solid rgba(45,55,72,.5);
  color: var(--cv-text-primary, #e2e8f0);
  vertical-align: middle;
}

.cv-pattern-stats-table tr:hover td,
.cv-detections-table tr:hover td,
.cv-consensus-table tr:hover td {
  background: rgba(255,255,255,.03);
}

/* ── Win-rate badge ────────────────────────────────────────────────────── */
.cv-wr-badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: .3rem;
  font-size: .8rem;
  font-weight: 600;
}
.cv-wr-good { background: rgba(34,197,94,.2);  color: #86efac; }
.cv-wr-mid  { background: rgba(234,179,8,.2);  color: #fde047; }
.cv-wr-bad  { background: rgba(239,68,68,.2);  color: #fca5a5; }

/* ── Direction badge ───────────────────────────────────────────────────── */
.cv-dir-badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: .3rem;
  font-size: .8rem;
  font-weight: 600;
  text-transform: capitalize;
}
.cv-dir-bullish { background: rgba(34,197,94,.2);  color: #86efac; }
.cv-dir-bearish { background: rgba(239,68,68,.2);  color: #fca5a5; }
.cv-dir-neutral { background: rgba(148,163,184,.2); color: #cbd5e1; }

/* ── Pattern badge ─────────────────────────────────────────────────────── */
.cv-pattern-badge {
  display: inline-block;
  padding: .1rem .4rem;
  border-radius: .25rem;
  background: rgba(99,102,241,.2);
  color: #a5b4fc;
  font-size: .8rem;
}

/* ── Detection row animation ───────────────────────────────────────────── */
.cv-det-row.cv-det-new {
  animation: cv-flash-in .6s ease-out;
}
@keyframes cv-flash-in {
  from { background: rgba(59,130,246,.25); }
  to   { background: transparent; }
}

/* ── Sidecar health indicator ──────────────────────────────────────────── */
.cv-sidecar-status {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
  font-size: .8rem;
  color: var(--cv-text-muted, #94a3b8);
}

.cv-health-dot {
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.cv-health-online  { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.cv-health-offline { background: #ef4444; }
.cv-health-unknown { background: #94a3b8; }

.cv-sidecar-detail {
  font-size: .75rem;
  color: var(--cv-text-muted, #94a3b8);
}

/* ── Details / summary ─────────────────────────────────────────────────── */
.cv-detections-details summary.cv-details-summary {
  cursor: pointer;
  font-size: .875rem;
  color: var(--cv-text-muted, #94a3b8);
  padding: .25rem 0 .75rem 0;
  list-style: none;
  user-select: none;
}
.cv-detections-details summary.cv-details-summary::before {
  content: '▶ ';
  font-size: .7rem;
}
.cv-detections-details[open] summary.cv-details-summary::before {
  content: '▼ ';
}

/* ── Score distribution chart ──────────────────────────────────────────── */
.cv-chart-wrapper {
  position: relative;
  max-height: 260px;
}

/* ── Consensus mode ────────────────────────────────────────────────────── */
.cv-consensus-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.cv-provider-checkboxes {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.cv-checkbox-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
}

.cv-checkbox-label input[type="checkbox"] {
  accent-color: var(--cv-accent, #3b82f6);
  width: 1rem;
  height: 1rem;
}

.cv-provider-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: .3rem;
  font-size: .8rem;
  font-weight: 600;
}
.cv-provider-openai    { background: rgba(16,163,127,.2); color: #6ee7b7; }
.cv-provider-anthropic { background: rgba(251,146,60,.2); color: #fed7aa; }
.cv-provider-google    { background: rgba(59,130,246,.2); color: #93c5fd; }

.cv-consensus-results {
  min-height: 3rem;
}

.cv-consensus-summary {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}

.cv-agree-badge {
  display: inline-block;
  padding: .25rem .75rem;
  border-radius: .4rem;
  font-size: .875rem;
  font-weight: 600;
}
.cv-agree-high { background: rgba(34,197,94,.2);  color: #86efac; }
.cv-agree-mid  { background: rgba(234,179,8,.2);  color: #fde047; }
.cv-agree-low  { background: rgba(239,68,68,.2);  color: #fca5a5; }

.cv-cost-badge {
  font-size: .8rem;
  color: var(--cv-text-muted, #94a3b8);
  padding: .2rem .5rem;
  background: rgba(255,255,255,.05);
  border-radius: .3rem;
}

.cv-verdict-cell {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .8rem;
  color: var(--cv-text-muted, #94a3b8);
}

.cv-link {
  color: var(--cv-accent, #3b82f6);
  text-decoration: none;
  font-size: .8rem;
}
.cv-link:hover { text-decoration: underline; }

/* ── Modal ─────────────────────────────────────────────────────────────── */
.cv-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.cv-modal-box {
  background: var(--cv-surface, #1e2530);
  border: 1px solid var(--cv-border, #2d3748);
  border-radius: .75rem;
  padding: 1.5rem;
  max-width: 720px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.cv-modal-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: none;
  border: none;
  color: var(--cv-text-muted, #94a3b8);
  font-size: 1.1rem;
  cursor: pointer;
  padding: .25rem .5rem;
  border-radius: .3rem;
}
.cv-modal-close:hover { background: rgba(255,255,255,.1); }

.cv-verdict-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .8rem;
  color: var(--cv-text-primary, #e2e8f0);
  line-height: 1.6;
}

/* ── Toast notifications ───────────────────────────────────────────────── */
.cv-toast {
  padding: .75rem 1.25rem;
  border-radius: .5rem;
  font-size: .875rem;
  font-weight: 500;
  max-width: 320px;
  animation: cv-toast-in .2s ease-out;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
@keyframes cv-toast-in {
  from { opacity: 0; transform: translateY(.5rem); }
  to   { opacity: 1; transform: translateY(0); }
}
.cv-toast-success { background: #166534; color: #dcfce7; }
.cv-toast-error   { background: #7f1d1d; color: #fee2e2; }
.cv-toast-warning { background: #713f12; color: #fef3c7; }
.cv-toast-info    { background: #1e3a5f; color: #dbeafe; }

/* ── State helpers ─────────────────────────────────────────────────────── */
.cv-loading { color: var(--cv-text-muted, #94a3b8); font-style: italic; padding: 1rem; text-align: center; }
.cv-empty   { color: var(--cv-text-muted, #94a3b8); padding: 1rem; text-align: center; }
.cv-error   { color: #fca5a5; padding: .5rem; }

/* ── cv-consensus-section ─────────────────────────────────────────── */
.cv-consensus-section {
  background: var(--cv-card-bg, #1a1a2e);
  border: 1px solid var(--cv-border, #2d2d4e);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}
.cv-consensus-section h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cv-muted, #888);
}
/* =============================================================================
   CandleVision v1.5.0 Phase 8 — candlevision_css_phase8.css
   Appended to static/css/candlevision_v130.css by apply_all_patches.sh

   Covers:
     - cv-low-conf-banner  (Track A: low-confidence verdict flag)
     - cv-high-conf-pill   (Track A: high-confidence verdict badge)
     - Backtest panel      (Track B: controls, metrics, equity chart, trades table)
   ============================================================================= */

/* ── Track A: Confidence Bands ─────────────────────────────────────────────── */

.cv-low-conf-banner {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  border-left: 3px solid #ef4444;
  color: #fca5a5;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  margin-bottom: 0.6rem;
  border-radius: 0 4px 4px 0;
  letter-spacing: 0.01em;
}

.cv-high-conf-pill {
  display: inline-block;
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #4ade80;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-left: 0.4rem;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

/* Container classes for verdict confidence band */
.cv-band-low  .cv-verdict-content { border-left: 2px solid #ef4444; }
.cv-band-high .cv-verdict-content { border-left: 2px solid #4ade80; }

/* ── Track B: Backtest Panel ────────────────────────────────────────────────── */

.cv-backtest-panel {
  margin-top: 1.25rem;
}

.cv-backtest-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 1rem;
}

.cv-ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 120px;
}

.cv-ctrl-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cv-ctrl-wide {
  flex: 1 1 100%;
}

.cv-ctrl-action {
  align-self: flex-end;
  min-width: auto;
}

.cv-input,
.cv-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 0.85rem;
  padding: 0.35rem 0.55rem;
  outline: none;
  transition: border-color 0.15s;
}

.cv-input:focus,
.cv-select:focus {
  border-color: rgba(99, 179, 237, 0.5);
}

.cv-slider {
  accent-color: #63b3ed;
  width: 100%;
}

.cv-pattern-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cv-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #cbd5e0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.12s;
}

.cv-checkbox-label:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Backtest results */
.cv-bt-results {
  animation: cv-fade-in 0.2s ease;
}

.cv-bt-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.cv-metric-card {
  flex: 1 1 100px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cv-metric-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cv-metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e2e8f0;
}

.cv-metric-danger {
  color: #fc8181;
}

/* Equity chart wrapper */
.cv-chart-wrapper {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

/* Trades table */
.cv-bt-trades-wrapper {
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.cv-bt-trades-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.cv-bt-trades-table th {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cv-bt-trades-table td {
  padding: 0.4rem 0.6rem;
  color: #cbd5e0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cv-bt-trades-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.cv-outcome-win  { color: #4ade80; font-weight: 600; }
.cv-outcome-loss { color: #fc8181; font-weight: 600; }
.cv-outcome-neutral { color: #a0aec0; }

.cv-pnl-pos { color: #4ade80; }
.cv-pnl-neg { color: #fc8181; }

/* Sidecar pill states */
.cv-sidecar-online  { color: #4ade80; }
.cv-sidecar-offline { color: #fc8181; }

/* Utility */
.cv-hidden  { display: none !important; }
.cv-muted   { color: rgba(255, 255, 255, 0.35); font-size: 0.8rem; }
.cv-loading-text { color: rgba(255, 255, 255, 0.4); font-size: 0.8rem; font-style: italic; }
.cv-error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 4px;
  color: #fca5a5;
  font-size: 0.82rem;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
}
.cv-loading-spinner {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  padding: 0.5rem;
  font-style: italic;
}

@keyframes cv-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* CV_P9_LIVE_WATCH_CSS */
/* ─────────────────────────────────────────────────────────────────────────────
   CandleVision v1.6.0 Phase 9 — Live Watch Mode styles
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Live Watch controls bar ────────────────────────────────────────────────── */
.cv-live-watch-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(15, 20, 30, 0.92);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-wrap: wrap;
}

.cv-btn-live-watch {
  background: #1a7a3c;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.cv-btn-live-watch:hover {
  background: #22a050;
}
.cv-btn-live-watch.active {
  background: #8b1a1a;
  position: relative;
  padding-left: 28px;
}
.cv-btn-live-watch.active::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4444;
  animation: cv-pulse-dot 1.2s ease-in-out infinite;
}
@keyframes cv-pulse-dot {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
  50%       { opacity: 0.4; transform: translateY(-50%) scale(1.4); }
}

.cv-select-sm {
  background: rgba(255,255,255,0.08);
  color: #e0e0e0;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.82rem;
}

.cv-live-watch-status {
  font-size: 0.78rem;
  color: #9aa0b0;
  min-width: 60px;
}

/* ── Cost meter ──────────────────────────────────────────────────────────────── */
.cv-cost-meter {
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  transition: color 0.4s, border-color 0.4s;
}
.cv-cost-meter.cv-cost-green  { color: #4caf50; border-color: #4caf50; }
.cv-cost-meter.cv-cost-yellow { color: #ffb300; border-color: #ffb300; }
.cv-cost-meter.cv-cost-red    { color: #f44336; border-color: #f44336; }

/* ── AI Tape panel ───────────────────────────────────────────────────────────── */
.cv-ai-tape {
  position: fixed;
  right: 16px;
  top: 120px;
  width: 320px;
  max-height: 70vh;
  overflow-y: auto;
  background: rgba(12, 16, 26, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 9000;
  font-size: 0.82rem;
  color: #d0d8e8;
}

.cv-ai-tape-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  background: rgba(12, 16, 26, 0.97);
  z-index: 1;
}
.cv-ai-tape-title {
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}
.cv-ai-tape-count {
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.75rem;
  color: #9aa0b0;
}

.cv-btn-ghost-sm {
  background: transparent;
  border: none;
  color: #9aa0b0;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  transition: color 0.2s;
}
.cv-btn-ghost-sm:hover { color: #fff; }

.cv-ai-tape-body {
  padding: 6px 0;
}
.cv-ai-tape-empty {
  padding: 20px 14px;
  color: #666;
  text-align: center;
  font-size: 0.8rem;
}

/* ── AI Tape row ─────────────────────────────────────────────────────────────── */
.cv-ai-tape-row {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  border-left: 3px solid transparent;
  transition: background 0.15s, transform 0.15s;
  cursor: default;
}
.cv-ai-tape-row:hover {
  background: rgba(255,255,255,0.04);
  transform: translateX(2px);
}
.cv-ai-tape-row.high-conf {
  border-left-color: #4caf50;
}
.cv-ai-tape-row.low-conf {
  border-left-color: #f44336;
}

.cv-ai-tape-row-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}
.cv-ai-tape-time   { color: #7a8090; font-size: 0.75rem; }
.cv-ai-tape-symbol { font-weight: 600; font-size: 0.8rem; color: #c8d0e0; }

.cv-ai-tape-row-body {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 3px;
}
.cv-ai-tape-direction { font-weight: 600; }
.cv-ai-tape-conf      { color: #9aa0b0; font-size: 0.75rem; }

.cv-ai-tape-row-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cv-ai-tape-cost { color: #7a8090; font-family: monospace; font-size: 0.75rem; }
.cv-ai-tape-open {
  background: transparent;
  border: none;
  color: #5b9bd5;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0;
  text-decoration: underline;
}
.cv-ai-tape-open:hover { color: #7ab8f5; }

/* ── Highlight flash ─────────────────────────────────────────────────────────── */
@keyframes cv-highlight-flash {
  0%   { box-shadow: 0 0 0 0 rgba(91,155,213,0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(91,155,213,0); }
  100% { box-shadow: 0 0 0 0 rgba(91,155,213,0); }
}
.cv-highlight-flash {
  animation: cv-highlight-flash 1.5s ease-out;
}
/* END CV_P9_LIVE_WATCH_CSS */

/* CV_P10_CONFLUENCE_CSS */
/* ─────────────────────────────────────────────────────────────────────────── */
/* CandleVision v1.7.0 Phase 10 — Confluence Alerts styles                    */
/* ─────────────────────────────────────────────────────────────────────────── */

/* Section wrapper */
.cv-confluence-section {
  margin-top: 1.5rem;
}

.cv-confluence-section .cv-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cv-conf-sound-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: auto;
}

/* Table */
.cv-conf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.cv-conf-table th {
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-bottom: 2px solid var(--cv-border, #334155);
  color: var(--cv-muted, #94a3b8);
  font-weight: 600;
  white-space: nowrap;
}

.cv-conf-table td {
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid var(--cv-border-light, #1e293b);
  vertical-align: middle;
}

.cv-conf-row:hover {
  background: var(--cv-row-hover, rgba(99,102,241,0.08));
  cursor: pointer;
}

/* Tier badges */
.cv-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cv-tier-watch  .cv-tier-badge,
.cv-tier-badge.cv-tier-watch  { background: rgba(234,179,8,0.18);  color: #eab308; border: 1px solid rgba(234,179,8,0.35); }
.cv-tier-setup  .cv-tier-badge,
.cv-tier-badge.cv-tier-setup  { background: rgba(34,197,94,0.18);  color: #22c55e; border: 1px solid rgba(34,197,94,0.35); }
.cv-tier-sniper .cv-tier-badge,
.cv-tier-badge.cv-tier-sniper { background: rgba(239,68,68,0.18);  color: #ef4444; border: 1px solid rgba(239,68,68,0.35); }

/* Row left-border accent by tier */
.cv-conf-row.cv-tier-watch  { border-left: 3px solid #eab308; }
.cv-conf-row.cv-tier-setup  { border-left: 3px solid #22c55e; }
.cv-conf-row.cv-tier-sniper { border-left: 3px solid #ef4444; }

/* Direction */
.cv-conf-dir { font-weight: 600; }

/* Action column — truncate */
.cv-conf-action {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--cv-muted, #94a3b8);
  font-size: 0.78rem;
}

/* Empty state */
.cv-conf-table td.cv-empty {
  text-align: center;
  color: var(--cv-muted, #94a3b8);
  padding: 1.5rem;
  font-style: italic;
}

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.cv-conf-modal {
  background: var(--cv-card-bg, #0f172a);
  border: 1px solid var(--cv-border, #334155);
  border-radius: 0.75rem;
  padding: 1.25rem;
  max-width: 860px;
  width: 95vw;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.cv-conf-modal-body {
  margin-top: 0.75rem;
}

.cv-conf-modal-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .cv-conf-modal-cols { grid-template-columns: 1fr; }
}

.cv-conf-modal-col h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cv-muted, #94a3b8);
  margin-bottom: 0.4rem;
}

.cv-conf-pre {
  background: var(--cv-code-bg, #020617);
  border: 1px solid var(--cv-border, #334155);
  border-radius: 0.4rem;
  padding: 0.6rem;
  font-size: 0.72rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow-y: auto;
  color: var(--cv-text, #e2e8f0);
}

.cv-conf-modal-action {
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--cv-text, #e2e8f0);
}

.cv-conf-modal-action.cv-tier-sniper {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.35);
}

.cv-conf-modal-action.cv-tier-setup {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.35);
}

/* ── Toast (if not already defined by prior phases) ─────────────────────────── */
.cv-conf-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  background: var(--cv-card-bg, #0f172a);
  border: 1px solid var(--cv-border, #334155);
  border-radius: 0.6rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--cv-text, #e2e8f0);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  max-width: 360px;
  animation: cv-toast-in 0.25s ease;
}

@keyframes cv-toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Count badge */
.cv-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  border-radius: 9999px;
  background: var(--cv-accent, #6366f1);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 0.35rem;
}

/* END CV_P10_CONFLUENCE_CSS */
/* ── CandleVision v1.8.0 Phase 11 — Pipeline Fixes + 60 Patterns ─────────── */
/* CV_P11_CSS_APPENDED */

/* ── Pattern catalogue panel ─────────────────────────────────────────────── */
#cv-pattern-catalogue {
  background: var(--cv-surface, #1a1a2e);
  border: 1px solid var(--cv-border, #2a2a4a);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

#cv-pattern-catalogue h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--cv-text-muted, #8888aa);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cv-pattern-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.cv-pattern-filters select {
  background: var(--cv-input-bg, #12122a);
  border: 1px solid var(--cv-border, #2a2a4a);
  color: var(--cv-text, #e0e0f0);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
}

#cv-pattern-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--cv-text-muted, #8888aa);
}

.cv-pattern-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.cv-pattern-table th {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--cv-border, #2a2a4a);
  color: var(--cv-text-muted, #8888aa);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.cv-pat-row {
  border-bottom: 1px solid rgba(42, 42, 74, 0.5);
  transition: background 0.15s;
}

.cv-pat-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.cv-pat-row td {
  padding: 0.35rem 0.5rem;
  vertical-align: middle;
}

.cv-pat-name {
  font-weight: 500;
  color: var(--cv-text, #e0e0f0);
}

/* Direction colours */
.cv-dir-bullish { color: #22c55e; }
.cv-dir-bearish { color: #ef4444; }
.cv-dir-neutral { color: #94a3b8; }

/* Category badges */
.cv-pat-cat {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cv-cat-reversal     { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.cv-cat-continuation { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.cv-cat-indecision   { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

/* Win rate column */
.cv-pat-wr {
  font-variant-numeric: tabular-nums;
  color: var(--cv-text-muted, #8888aa);
}

/* Candles column */
.cv-pat-candles {
  color: var(--cv-text-muted, #8888aa);
  text-align: center;
}

/* ── Live Watch parse-rate pill ───────────────────────────────────────────── */
.cv-stat-lw {
  background: rgba(234, 179, 8, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

/* ── Loading / empty / error states ─────────────────────────────────────── */
.cv-loading, .cv-empty, .cv-error {
  text-align: center;
  padding: 1rem;
  color: var(--cv-text-muted, #8888aa);
  font-size: 0.8rem;
}

.cv-error { color: #f87171; }

/* CV_P12_AUTOCOMPLETE_CSS */
/* CandleVision v1.9.0 Phase 12 — Universal Tickers autocomplete styles */
/* Appended to candlevision_v130.css by apply_all_patches.sh (Step 7) */

/* ── Ticker input wrapper ─────────────────────────────────────────────────── */
.cv-ticker-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 420px;
}

#cv-ticker-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #3a3f4b;
  border-radius: 6px;
  background: #1a1d24;
  color: #e8eaf0;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#cv-ticker-input:focus {
  border-color: #5b9cf6;
  box-shadow: 0 0 0 2px rgba(91, 156, 246, 0.18);
}

/* ── Asset-class badge (next to input) ───────────────────────────────────── */
.cv-asset-class-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.cv-asset-class-badge--stock   { background: #1e3a5f; color: #5b9cf6; }
.cv-asset-class-badge--crypto  { background: #3b2a00; color: #f5a623; }
.cv-asset-class-badge--forex   { background: #1a3a2a; color: #4caf7d; }
.cv-asset-class-badge--option  { background: #3a1a3a; color: #c97cf6; }
.cv-asset-class-badge--unknown { background: #2a2a2a; color: #888; }

/* ── Autocomplete dropdown ────────────────────────────────────────────────── */
#cv-ticker-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 9999;
  background: #1e2130;
  border: 1px solid #3a3f4b;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  max-height: 280px;
  overflow-y: auto;
}

.cv-ac-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  cursor: pointer;
  border-bottom: 1px solid #2a2d38;
  transition: background 0.12s;
}

.cv-ac-item:last-child { border-bottom: none; }

.cv-ac-item:hover,
.cv-ac-item.active {
  background: #252a3a;
}

.cv-ac-symbol {
  font-size: 13px;
  font-weight: 600;
  color: #e8eaf0;
}

.cv-ac-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cv-ac-badge--stock   { background: #1e3a5f; color: #5b9cf6; }
.cv-ac-badge--crypto  { background: #3b2a00; color: #f5a623; }
.cv-ac-badge--forex   { background: #1a3a2a; color: #4caf7d; }
.cv-ac-badge--option  { background: #3a1a3a; color: #c97cf6; }
.cv-ac-badge--unknown { background: #2a2a2a; color: #888; }

/* ── Symbol info strip ───────────────────────────────────────────────────── */
#cv-symbol-info {
  display: none;
  padding: 6px 12px;
  background: #181b24;
  border: 1px solid #2a2d38;
  border-radius: 6px;
  font-size: 12px;
  color: #aab0c0;
  margin-top: 6px;
}

.cv-si-price { color: #e8eaf0; font-weight: 600; }
.cv-si-date  { color: #6b7280; }
.cv-si-table { color: #5b9cf6; }

/* ── Pattern threshold table ─────────────────────────────────────────────── */
#cv-pattern-thresholds-panel {
  margin-top: 18px;
}

#cv-pattern-thresholds-panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

#cv-pattern-thresholds-panel th {
  background: #1e2130;
  color: #8892a4;
  font-weight: 600;
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid #2a2d38;
}

#cv-pattern-thresholds-panel td {
  padding: 6px 10px;
  border-bottom: 1px solid #1e2130;
  color: #c8cdd8;
}

.cv-threshold-cell {
  font-weight: 700;
  color: #5b9cf6 !important;
  text-align: right;
}

.cv-cat-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 600;
}

.cv-cat-badge--reversal     { background: #1e3a5f; color: #5b9cf6; }
.cv-cat-badge--continuation { background: #1a3a2a; color: #4caf7d; }
.cv-cat-badge--indecision   { background: #3b2a00; color: #f5a623; }

/* ── Asset-class filter buttons ──────────────────────────────────────────── */
.cv-class-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.cv-class-filter-btn {
  padding: 5px 14px;
  border-radius: 16px;
  border: 1px solid #3a3f4b;
  background: transparent;
  color: #8892a4;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.cv-class-filter-btn:hover { border-color: #5b9cf6; color: #5b9cf6; }
.cv-class-filter-btn.active { background: #1e3a5f; border-color: #5b9cf6; color: #5b9cf6; }
