/**
 * Canvas Dashboard Styles
 */

/* === Page Layout === */
.canvas-page {
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* === Page Header === */
.canvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.canvas-branding {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
}

.brand-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: 0.08em;
}

.brand-sep {
  color: var(--muted-foreground);
  opacity: 0.5;
}

.brand-page {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--muted-foreground);
}

.canvas-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.last-updated {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* === Intro Strip === */
.intro-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-left: 2px solid var(--zinc-600);
  padding-left: 0.75rem;
  margin-bottom: 0.25rem;
}

.intro-marker {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--zinc-500);
  background: var(--secondary);
  padding: 0.1875rem 0.375rem;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.intro-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.4;
  margin: 0;
}

@media (max-width: 640px) {
  .intro-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
  }
}

.refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--secondary);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

.refresh-btn:hover {
  color: var(--foreground);
  border-color: var(--ring);
}

.refresh-btn.loading svg {
  animation: spin 1s linear infinite;
}

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

/* === Loading & Error States === */
.canvas-loading {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.canvas-error {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 2rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.error-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.error-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--destructive);
  color: var(--destructive);
  font-weight: 600;
}

.btn-retry {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--secondary);
  border: 1px solid var(--border);
  color: var(--foreground);
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-retry:hover {
  border-color: var(--ring);
}

/* === Skeleton Loading === */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}

.skeleton-module {
  background: var(--card);
  border: 1px solid var(--border);
  height: 320px;
  display: flex;
  flex-direction: column;
}

.skeleton-module:nth-child(1) { grid-column: span 4; }
.skeleton-module:nth-child(2) { grid-column: span 2; }
.skeleton-module:nth-child(3) { grid-column: span 3; }
.skeleton-module:nth-child(4) { grid-column: span 3; }

.skeleton-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 48px;
  border-bottom: 1px solid var(--border);
}

.skeleton-title {
  height: 14px;
  width: 120px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 400px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-badge {
  height: 12px;
  width: 80px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 100%);
  background-size: 400px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-body {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skeleton-metrics {
  display: flex;
  gap: 1.5rem;
}

.skeleton-metric {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skeleton-value {
  height: 28px;
  width: 80px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 100%);
  background-size: 400px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-label {
  height: 10px;
  width: 60px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 100%);
  background-size: 400px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-chart {
  flex: 1;
  margin-top: auto;
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.04) 50%, rgba(255,255,255,0.02) 100%);
  background-size: 400px 100%;
  animation: shimmer 2s ease-in-out infinite;
  border-top: 1px solid var(--border);
}

.skeleton-row {
  display: flex;
  gap: 0.75rem;
}

.skeleton-pill {
  height: 24px;
  width: 56px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 400px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-levels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.skeleton-level-module {
  background: var(--card);
  border: 1px solid var(--border);
  height: 360px;
}

.skeleton-level-chart {
  flex: 1;
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.04) 50%, rgba(255,255,255,0.02) 100%);
  background-size: 400px 100%;
  animation: shimmer 2s ease-in-out infinite;
}

.canvas-loading.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.module-grid.fade-in,
.levels-grid.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

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

/* === Module Grid === */
.module-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}

#module-breadth { grid-column: span 4; }
#module-positioning { grid-column: span 2; }
#module-sentiment { grid-column: span 3; }
#module-volatility { grid-column: span 3; }

/* === Module Base === */
.module {
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 320px;
  transition: border-color 0.2s ease;
}

.module:hover {
  border-color: var(--ring);
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  height: 48px;
}

.module-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.module-title {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}

.module-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-foreground);
  opacity: 0.4;
}

.module-indicator.bullish { background: #22c55e; opacity: 1; }
.module-indicator.bearish { background: #ef4444; opacity: 1; }
.module-indicator.neutral { background: #f59e0b; opacity: 1; }

.module-source {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}

.module-body {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
}

/* === Collapsed/Expanded Views === */
.module-collapsed {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.module-expanded {
  display: none;
}

.module.expanded .module-collapsed {
  display: none;
}

.module.expanded .module-expanded {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.module.dimmed {
  display: none;
}

/* === Expanded Module (Full Screen) === */
.module.expanded {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 1.5rem;
  width: auto;
  height: auto;
  z-index: 1000;
  border: 1px solid var(--border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: expandIn 0.3s ease-out forwards;
}

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

.module.expanded .module-body {
  cursor: default;
  flex: 1;
  padding: 1.5rem;
  overflow: hidden;
}

/* Backdrop */
.module-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 999;
  pointer-events: none;
  transition: background 0.25s ease;
}

.module-backdrop.visible {
  background: rgba(0, 0, 0, 0.85);
  pointer-events: auto;
}

/* === Breadth Module === */
.breadth-summary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}

.universe-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.universe-toggle .toggle-btn {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  padding: 0.25rem 0.625rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.universe-toggle .toggle-btn:hover {
  border-color: var(--ring);
  color: var(--foreground);
}

.universe-toggle .toggle-btn.active {
  background: var(--secondary);
  border-color: var(--ring);
  color: var(--foreground);
}

.breadth-metrics {
  display: flex;
  gap: 1.5rem;
}

.metric-block {
  flex-shrink: 0;
}

.metric-value-large {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--foreground);
  line-height: 1;
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.metric-sublabel-note {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--zinc-500);
  margin-top: 0.125rem;
}

.ma-percentiles {
  flex: 1;
}

.ma-pct-header {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--zinc-500);
  margin-bottom: 0.5rem;
}

.ma-pct-note {
  color: var(--zinc-600);
  margin-left: 0.375rem;
}

.ma-pct-row {
  display: flex;
  gap: 1.5rem;
}

.ma-pct-item {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
}

.ma-pct-val {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.ma-pct-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--zinc-500);
}

/* Sparkline section */
.sparkline-section {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 70px;
}

.sparkline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
  flex-shrink: 0;
}

.sparkline-title {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--zinc-500);
}

.sparkline-date {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--zinc-600);
}

.chart-area {
  flex: 1;
  min-height: 50px;
  width: 100%;
}

/* Percentile colors */
.extreme-low { color: #ef4444 !important; }
.low { color: #f97316 !important; }
.high { color: #22c55e !important; }
.extreme-high { color: #10b981 !important; }

/* === Positioning Module === */
.cot-table {
  display: flex;
  flex-direction: column;
  flex: 1;
}

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

.cot-header-symbol {
  min-width: 70px;
}

.cot-header-cols {
  display: flex;
  gap: 0.75rem;
}

.cot-col-label {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  text-transform: uppercase;
  width: 56px;
  text-align: center;
}

.cot-col-label.am { color: #22c55e; }
.cot-col-label.ch { color: #f59e0b; }
.cot-col-label.rt { color: #ef4444; }

.cot-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cot-symbol {
  display: flex;
  flex-direction: column;
  min-width: 70px;
}

.cot-symbol-name {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
}

.cot-symbol-desc {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--zinc-500);
}

.cot-pcts {
  display: flex;
  gap: 0.75rem;
}

.cot-pct {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--foreground);
  width: 56px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--secondary);
  border-bottom: 2px solid transparent;
}

.cot-pct .bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  opacity: 0.25;
}

.cot-pct .value {
  position: relative;
  z-index: 1;
}

.cot-pct.am { border-color: #22c55e; }
.cot-pct.am .bar { background: #22c55e; }
.cot-pct.ch { border-color: #f59e0b; }
.cot-pct.ch .bar { background: #f59e0b; }
.cot-pct.rt { border-color: #ef4444; }
.cot-pct.rt .bar { background: #ef4444; }

.cot-footer {
  margin-top: auto;
  padding-top: 0.5rem;
}

.cot-footnote {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--zinc-600);
}

/* === Sentiment Module === */
.sentiment-content {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

.sentiment-main {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 90px;
  flex-shrink: 0;
}

.sentiment-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--foreground);
  line-height: 1;
}

.sentiment-value::after {
  content: '%';
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-left: 2px;
}

.sentiment-meta {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sentiment-delta {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}

.sentiment-delta.positive { color: #22c55e; }
.sentiment-delta.negative { color: #ef4444; }

.sentiment-percentile {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}

.sentiment-date {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--zinc-600);
}

.sentiment-chart {
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.sentiment-chart .chart-area {
  height: 100%;
  min-height: 60px;
}

/* === Volatility Module === */
.vol-content {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

.vol-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-shrink: 0;
}

.vol-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--foreground);
  line-height: 1;
}

.vol-meta {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.vol-regime {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
}

.vol-regime.low { color: #22c55e; }
.vol-regime.normal { color: var(--muted-foreground); }
.vol-regime.elevated { color: #f59e0b; }
.vol-regime.high { color: #ef4444; }

.vol-change {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}

.vol-date {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--zinc-600);
}

.vol-chart {
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.vol-chart .chart-area {
  height: 100%;
  min-height: 60px;
}

.vol-percentiles {
  flex-shrink: 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.vol-pct-header {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--zinc-500);
  margin-bottom: 0.375rem;
}

.vol-pct-row {
  display: flex;
  gap: 1.5rem;
}

.vol-pct-item {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
}

.vol-pct-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--zinc-500);
}

.vol-pct-val {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

/* === Expanded View Components === */

.expanded-summary {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.summary-metric {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.summary-metric.primary {
  min-width: 100px;
}

.summary-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--foreground);
  line-height: 1;
}

.summary-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.summary-divider {
  width: 1px;
  height: 44px;
  background: var(--border);
  flex-shrink: 0;
}

.summary-metrics-row {
  display: flex;
  gap: 1.25rem;
}

.summary-value-sm {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.summary-label-sm {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted-foreground);
  text-transform: uppercase;
}

/* Positioning summary */
.summary-cot-table {
  display: flex;
  gap: 1.5rem;
}

.summary-cot-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.summary-cot-symbol {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--foreground);
}

.summary-cot-pcts {
  display: flex;
  gap: 0.5rem;
}

.summary-cot-pct {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.125rem 0.375rem;
  background: var(--secondary);
}

.summary-cot-pct.am { color: #22c55e; border-bottom: 2px solid #22c55e; }
.summary-cot-pct.ch { color: #f59e0b; border-bottom: 2px solid #f59e0b; }
.summary-cot-pct.rt { color: #ef4444; border-bottom: 2px solid #ef4444; }

/* Sentiment summary */
.summary-sentiment {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.summary-sentiment-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--foreground);
}

.summary-sentiment-value::after {
  content: '%';
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-left: 2px;
}

/* Volatility summary */
.summary-vol {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.summary-vol-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--foreground);
}

.summary-vol-regime {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  background: var(--secondary);
}

.summary-vol-regime.low { color: #22c55e; border-left: 2px solid #22c55e; }
.summary-vol-regime.normal { color: var(--muted-foreground); border-left: 2px solid var(--muted-foreground); }
.summary-vol-regime.elevated { color: #f59e0b; border-left: 2px solid #f59e0b; }
.summary-vol-regime.high { color: #ef4444; border-left: 2px solid #ef4444; }

/* Expanded controls bar */
.expanded-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.expanded-controls-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.expanded-controls-left .universe-toggle {
  margin-bottom: 0;
}

.range-selector {
  display: flex;
  border: 1px solid var(--border);
}

.range-btn {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.range-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}

.range-btn:hover {
  color: var(--foreground);
}

.range-btn.active {
  background: var(--secondary);
  color: var(--foreground);
}

.collapse-btn {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  background: var(--secondary);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.collapse-btn:hover {
  color: var(--foreground);
  border-color: var(--ring);
}

/* === Expanded Charts === */
.expanded-charts {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  overflow: hidden;
}

.expanded-charts.stacked {
  gap: 0.75rem;
}

.expanded-charts.stacked .chart-container {
  flex: 1;
  min-height: 100px;
}

.chart-row {
  display: flex;
  gap: 1rem;
  min-height: 0;
  flex: 1 1 0%;
}

/* First row takes 45%, second row takes 55% */
.chart-row:first-child {
  flex: 1 1 0%;
}

.chart-row:last-child {
  flex: 1 1 0%;
}

.chart-row.dual .chart-container {
  flex: 1;
}

.chart-container {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.chart-container.full {
  flex: 1;
}

.chart-title {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  z-index: 1;
}

/* === Hint === */
.canvas-hint {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.canvas-hint span {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--muted-foreground);
}

.hint-sep {
  opacity: 0.5;
}

/* === Levels Grid === */
.levels-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.level-module {
  height: 360px;
}

.level-module .module-body {
  padding: 0.5rem;
}

.level-chart {
  width: 100%;
  height: 100%;
}

/* === Responsive === */
@media (max-width: 1024px) {
  .module-grid {
    grid-template-columns: 1fr;
  }

  #module-breadth,
  #module-positioning,
  #module-sentiment,
  #module-volatility {
    grid-column: 1;
  }

  .skeleton-grid {
    grid-template-columns: 1fr;
  }

  .skeleton-module:nth-child(n) {
    grid-column: 1;
  }

  .levels-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .canvas-header {
    flex-direction: column;
    gap: 1rem;
  }

  .canvas-meta {
    width: 100%;
    justify-content: space-between;
  }

  .module {
    height: 280px;
  }

  .expanded-controls {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .chart-row.dual {
    flex-direction: column;
  }
}

/* === Economic Calendar Module === */
.calendar-section {
  margin-top: 0.5rem;
}

.calendar-module {
  background: var(--card);
  border: 1px solid var(--border);
  height: auto;
  min-height: 280px;
  max-height: 420px;
  position: relative;
}

.calendar-module .module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  height: 48px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.calendar-module .module-body {
  padding: 1rem;
  height: calc(100% - 48px);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Calendar Filter Toggle */
.calendar-filter {
  display: flex;
  border: 1px solid var(--border);
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  padding: 0.25rem 0.625rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}

.filter-btn:hover {
  color: var(--foreground);
}

.filter-btn.active {
  background: var(--secondary);
  color: var(--foreground);
}

/* Week Navigation */
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.week-tabs {
  display: flex;
  flex: 1;
  gap: 0.25rem;
  overflow-x: auto;
}

.week-tab {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted-foreground);
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
}

.week-tab:hover {
  color: var(--foreground);
}

.week-tab.active {
  background: var(--secondary);
  border-color: var(--border);
  color: var(--foreground);
}

.week-tab .week-dates {
  font-size: 9px;
  color: var(--muted-foreground);
  opacity: 0.7;
}

.week-tab.active .week-dates {
  opacity: 1;
}

/* 5-Day Trading Week Grid */
.calendar-week-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border);
  flex: 1;
  min-height: 180px;
}

.calendar-day-cell {
  background: var(--card);
  display: flex;
  flex-direction: column;
  min-height: 140px;
}

.calendar-day-cell.today {
  background: var(--card);
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.day-name {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--foreground);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.day-num {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.calendar-day-cell.today .day-num {
  color: #fff;
  background: #3b82f6;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.day-events {
  flex: 1;
  padding: 0.375rem;
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
  overflow-y: auto;
}

.day-events::-webkit-scrollbar {
  width: 3px;
}

.day-events::-webkit-scrollbar-track {
  background: transparent;
}

.day-events::-webkit-scrollbar-thumb {
  background: var(--muted-foreground);
  border-radius: 2px;
  opacity: 0.5;
}

.day-event {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  padding: 0.1875rem 0.25rem;
  background: var(--secondary);
  border-left: 2px solid transparent;
  cursor: pointer;
  display: flex;
  gap: 0.25rem;
  align-items: baseline;
  transition: background 0.1s ease;
}

.day-event:hover {
  background: rgba(255, 255, 255, 0.08);
}

.day-event.impact-high {
  border-left-color: #3b82f6;
}

.day-event.impact-medium {
  border-left-color: #f59e0b;
}

.day-event-time {
  color: var(--muted-foreground);
  flex-shrink: 0;
  min-width: 32px;
}

.day-event-name {
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-overflow {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: #3b82f6;
  padding: 0.25rem;
  text-align: center;
  cursor: pointer;
  transition: color 0.1s ease;
}

.day-overflow:hover {
  color: #60a5fa;
}

.day-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  opacity: 0.2;
  font-size: 0.875rem;
}

/* Legacy: Date Group Header (kept for detail panel) */
.date-header {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--foreground);
  padding: 0.5rem 0.75rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Event Row - TradingView Style */
.event-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--secondary);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.event-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Impact Indicator - TradingView Blue Bar Style */
.event-row.impact-high {
  border-left-color: #3b82f6;
}

.event-row.impact-medium {
  border-left-color: #f59e0b;
}

.event-row.impact-low {
  border-left-color: var(--muted-foreground);
}

.event-time {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.event-time .time {
  color: var(--foreground);
  font-weight: 500;
}

.event-time .date {
  font-size: 9px;
}

.event-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.event-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-country {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted-foreground);
}

.country-flag {
  font-size: 0.75rem;
}

/* Impact Badge */
.impact-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.0625rem 0.25rem;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.impact-badge.high {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.impact-badge.medium {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.impact-badge.low {
  background: rgba(113, 113, 122, 0.15);
  color: var(--muted-foreground);
}

/* Event Values */
.event-values {
  display: flex;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

.event-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.0625rem;
  min-width: 40px;
}

.event-value .label {
  font-size: 8px;
  color: var(--muted-foreground);
  text-transform: uppercase;
}

.event-value .value {
  font-weight: 500;
  color: var(--foreground);
}

.event-value .value.actual {
  color: #22c55e;
}

.event-value .value.forecast {
  color: var(--muted-foreground);
}

.event-value .value.prev {
  color: var(--muted-foreground);
  opacity: 0.7;
}

/* Event Detail Panel */
.calendar-detail {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card);
  z-index: 10;
  display: flex;
  flex-direction: column;
}

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

.detail-event-name {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
}

.detail-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--secondary);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

.detail-close:hover {
  color: var(--foreground);
  border-color: var(--ring);
}

.detail-body {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
}

.detail-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}

.detail-value {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--foreground);
}

/* No Events State */
.calendar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
  flex: 1;
}

/* Calendar Responsive */
@media (max-width: 900px) {
  .calendar-week-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .calendar-day-cell {
    min-height: 120px;
  }
}

@media (max-width: 640px) {
  .calendar-week-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .calendar-day-cell {
    min-height: 100px;
  }

  .day-event-time {
    display: none;
  }

  .calendar-filter {
    order: 3;
    width: 100%;
    margin-top: 0.5rem;
  }

  .filter-btn {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .calendar-week-grid {
    grid-template-columns: 1fr;
  }

  .calendar-module {
    max-height: none;
  }

  .calendar-day-cell {
    min-height: 80px;
  }
}

/* === Market Narratives Module === */
.narratives-section {
  margin-top: 0.5rem;
}

.narratives-module {
  position: relative;
}

.narratives-body {
  padding: 0;
}

/* Mood Badge in header */
.narratives-mood {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  background: var(--secondary);
}

.narratives-mood.risk-on {
  color: #22c55e;
  border-left: 2px solid #22c55e;
}

.narratives-mood.risk-off {
  color: #ef4444;
  border-left: 2px solid #ef4444;
}

.narratives-mood.uncertain {
  color: #f59e0b;
  border-left: 2px solid #f59e0b;
}

/* Three Sub-Module Grid */
.narratives-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
}

.narratives-col {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: var(--card);
}

/* Sub-Module Headers */
.narratives-col-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--secondary);
}

.narratives-col-icon {
  font-size: 0.875rem;
  line-height: 1;
}

.narratives-col.bullish .narratives-col-icon { color: #22c55e; }
.narratives-col.neutral .narratives-col-icon { color: #f59e0b; }
.narratives-col.bearish .narratives-col-icon { color: #ef4444; }

.narratives-col-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.narratives-col.bullish .narratives-col-label { color: #22c55e; }
.narratives-col.neutral .narratives-col-label { color: #f59e0b; }
.narratives-col.bearish .narratives-col-label { color: #ef4444; }

/* Column Items */
.narratives-col-items {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Individual Title Item */
.narrative-title-item {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.narrative-title-item:last-child {
  border-bottom: none;
}

.narrative-title-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.narrative-title-item:active {
  transform: scale(0.99);
}

.narrative-title-cat {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.125rem 0.3125rem;
  margin-bottom: 0.375rem;
  background: rgba(255, 255, 255, 0.05);
}

.narrative-title-cat.cat-central_banks { color: #f59e0b; border-left: 2px solid #f59e0b; }
.narrative-title-cat.cat-economic { color: #3b82f6; border-left: 2px solid #3b82f6; }
.narrative-title-cat.cat-geopolitical { color: #ef4444; border-left: 2px solid #ef4444; }
.narrative-title-cat.cat-earnings { color: #8b5cf6; border-left: 2px solid #8b5cf6; }
.narrative-title-cat.cat-sector { color: #06b6d4; border-left: 2px solid #06b6d4; }
.narrative-title-cat.cat-market { color: #22c55e; border-left: 2px solid #22c55e; }

.narrative-title-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--foreground);
  line-height: 1.4;
  margin: 0;
}

.narratives-col-empty {
  padding: 1.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  text-align: center;
  opacity: 0.6;
}

/* Narratives Empty State */
.narratives-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
}

/* === Narrative Modal === */
.narrative-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.narrative-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.narrative-modal {
  background: var(--card);
  border: 1px solid var(--border);
  width: 90%;
  max-width: 520px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s ease;
}

.narrative-modal-overlay.active .narrative-modal {
  transform: scale(1) translateY(0);
}

.narrative-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--secondary);
}

.narrative-modal-category {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
}

.narrative-modal-category.cat-central_banks { color: #f59e0b; border-left: 2px solid #f59e0b; }
.narrative-modal-category.cat-economic { color: #3b82f6; border-left: 2px solid #3b82f6; }
.narrative-modal-category.cat-geopolitical { color: #ef4444; border-left: 2px solid #ef4444; }
.narrative-modal-category.cat-earnings { color: #8b5cf6; border-left: 2px solid #8b5cf6; }
.narrative-modal-category.cat-sector { color: #06b6d4; border-left: 2px solid #06b6d4; }
.narrative-modal-category.cat-market { color: #22c55e; border-left: 2px solid #22c55e; }

.narrative-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

.narrative-modal-close:hover {
  background: var(--border);
  color: var(--foreground);
}

.narrative-modal-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  line-height: 1.4;
  margin: 0;
  padding: 1.25rem 1.25rem 0.75rem;
}

.narrative-modal-sentiment {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.25rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

.narrative-modal-sentiment-label {
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.narrative-modal-sentiment-value {
  font-weight: 600;
}

.narrative-modal-sentiment-value.bullish { color: #22c55e; }
.narrative-modal-sentiment-value.bearish { color: #ef4444; }
.narrative-modal-sentiment-value.mixed { color: #f59e0b; }

.narrative-modal-body {
  flex: 1;
  padding: 0 1.25rem 1.25rem;
  overflow-y: auto;
}

.narrative-modal-summary {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  line-height: 1.7;
  margin: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .narratives-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .narrative-modal {
    width: 95%;
    max-height: 85vh;
  }
}

/* ============================================
   SYNTHESIS TICKER (Header News Strip)
   ============================================ */

.synthesis-ticker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  max-width: 70%;
  min-width: 0;
  height: 2rem;
  margin: 0 1rem;
  overflow: hidden;
  /* Allow scroll events to pass through to body */
  touch-action: pan-y;
}

.synthesis-ticker.ticker-empty {
  opacity: 0.6;
}

.ticker-badge {
  flex-shrink: 0;
}

.ticker-regime {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.5rem;
  border-radius: 2px;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  background: transparent;
  white-space: nowrap;
}

.ticker-regime.risk-on {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.1);
}

.ticker-regime.risk-off {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.1);
}

.ticker-regime.transitional {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.1);
}

.ticker-track {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker-track::before,
.ticker-track::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2rem;
  z-index: 2;
  pointer-events: none;
}

.ticker-track::before {
  left: 0;
  background: linear-gradient(to right, var(--background), transparent);
}

.ticker-track::after {
  right: 0;
  background: linear-gradient(to left, var(--background), transparent);
}

.ticker-content {
  display: flex;
  align-items: center;
  white-space: nowrap;
  cursor: pointer;
}

.ticker-loading {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  font-style: italic;
  padding-left: 0.5rem;
}

/* Seamless ticker scroll animation */
.ticker-scroll {
  display: inline-flex;
  animation: ticker-marquee 60s linear infinite;
}

/* Pause animation on hover - removed as it was blocking scroll */

.ticker-scroll-inner {
  display: inline-flex;
  align-items: center;
  padding-right: 3rem;
}

@keyframes ticker-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-33.333%); }
}

.ticker-item {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--foreground);
  letter-spacing: 0.01em;
}

.ticker-sep {
  color: var(--muted-foreground);
  opacity: 0.4;
  margin: 0 0.75rem;
}

.ticker-focus {
  color: var(--foreground);
  font-weight: 500;
}

.ticker-context {
  color: var(--muted-foreground);
}

.ticker-bull {
  color: #22c55e;
  font-weight: 600;
}

.ticker-bear {
  color: #ef4444;
  font-weight: 600;
}

.ticker-signal-name {
  font-weight: 500;
}

.ticker-signal-name.bullish { color: rgba(34, 197, 94, 0.9); }
.ticker-signal-name.bearish { color: rgba(239, 68, 68, 0.9); }

.ticker-risks {
  color: #f59e0b;
}

.ticker-levels {
  color: var(--muted-foreground);
}

.ticker-conviction {
  color: var(--muted-foreground);
  text-transform: uppercase;
  font-size: 0.625rem;
  letter-spacing: 0.05em;
}

.ticker-expand {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.35rem;
  cursor: pointer;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.ticker-expand:hover {
  color: var(--foreground);
  border-color: var(--foreground);
  background: rgba(255, 255, 255, 0.05);
}

/* Responsive - hide ticker on small screens */
@media (max-width: 768px) {
  .synthesis-ticker {
    display: none;
  }
}

/* ============================================
   SYNTHESIS MODAL (Full Briefing)
   ============================================ */

.synthesis-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.synthesis-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.synthesis-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90%;
  max-width: 680px;
  max-height: 85vh;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.synthesis-modal.open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.synthesis-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--secondary);
}

.synthesis-modal-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.synthesis-modal-title h2 {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
  letter-spacing: 0.02em;
}

.modal-regime {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.5rem;
  border-radius: 2px;
  border: 1px solid var(--border);
}

.modal-regime.risk-on {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.1);
}

.modal-regime.risk-off {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.1);
}

.modal-regime.transitional {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.1);
}

.modal-conviction {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.synthesis-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s ease;
}

.synthesis-modal-close:hover {
  color: var(--foreground);
}

.synthesis-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.modal-summary {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.75;
  color: var(--foreground);
  margin-bottom: 1.25rem;
}

.modal-summary p {
  margin: 0 0 1rem;
}

.modal-summary p:last-child {
  margin-bottom: 0;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.modal-section {
  background: var(--secondary);
  border-radius: var(--radius);
  padding: 0.875rem;
}

.modal-section h3 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-signals {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-signal {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
}

.modal-signal-arrow {
  flex-shrink: 0;
  font-weight: 600;
}

.modal-signal.bullish .modal-signal-arrow { color: #22c55e; }
.modal-signal.bearish .modal-signal-arrow { color: #ef4444; }
.modal-signal.neutral .modal-signal-arrow { color: #71717a; }

.modal-signal-text {
  color: var(--foreground);
}

.modal-signal-reason {
  color: var(--muted-foreground);
  font-size: 0.6875rem;
}

.modal-risks {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-risk {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.modal-risk-icon {
  color: #f59e0b;
  flex-shrink: 0;
}

.modal-levels {
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--secondary);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.modal-level-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-level-symbol {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--foreground);
  padding: 0.25rem 0.5rem;
  background: var(--card);
  border-radius: var(--radius-sm);
}

.modal-level {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.modal-level.bull { color: #22c55e; }
.modal-level.bear { color: #ef4444; }

.modal-focus {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--foreground);
  font-style: italic;
  padding: 0.75rem 1rem;
  background: rgba(34, 197, 94, 0.1);
  border-left: 3px solid #22c55e;
  border-radius: var(--radius-sm);
}

.synthesis-modal-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--secondary);
}

.modal-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-style: italic;
  padding: 0.75rem 1rem;
  background: var(--secondary);
  border-radius: var(--radius-sm);
  margin-top: 1rem;
}

.modal-timestamp {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}

/* Responsive */
@media (max-width: 768px) {
  .synthesis-modal {
    width: 95%;
    max-height: 90vh;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

  .modal-levels {
    flex-direction: column;
    gap: 0.75rem;
  }
}
