.page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 88px 12px 24px; /* Reduced side padding from 24px to 12px */
  display: grid;
  grid-template-rows: auto 1fr auto;
  row-gap: 18px;
}

main {
  max-width: 1100px;
  margin: 12px auto 32px; /* Reduced top margin */
  padding: 0 8px; /* Reduced side padding from 24px to 8px */
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr);
  gap: 12px; /* Reduced gap */
  align-items: flex-start;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 900px) {
  main {
    grid-template-columns: minmax(0, 1fr);
  }
}

.card {
  border-radius: var(--border-radius-lg);
  background: radial-gradient(circle at top left, #111827 0, #020617 58%);
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: var(--shadow-soft);
  padding: 12px 10px 12px; /* Reduced padding from 18px to 10px horizontal */
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

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

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Live news styles */

.live-news {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-news-item {
  border-radius: var(--border-radius-sm);
  padding: 10px 10px 9px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.live-news-item-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.live-news-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.6);
  width: fit-content;
}

.live-news-title {
  font-size: 0.86rem;
  color: var(--text-main);
}

.sessions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 900px) {
  .sessions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .sessions-grid {
    grid-template-columns: 1fr;
  }
}

.session {
  position: relative;
  border-radius: var(--border-radius-sm);
  padding: 12px 12px 10px;
  background: linear-gradient(145deg, #020617, #020617);
  border: 1px solid rgba(148, 163, 184, 0.45);
  overflow: hidden;
  cursor: default;
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.session::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top,
    rgba(56, 189, 248, 0.2),
    transparent 60%
  );
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.session:hover {
  transform: translateY(-2px) translateZ(0);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.9);
  border-color: rgba(56, 189, 248, 0.8);
  background: radial-gradient(circle at top, #020617, #020617 55%);
}

.session:hover::before {
  opacity: 1;
}

.session-tag {
  display: block;
  font-size: 0.7rem;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.session-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 6px;
}

.session-name {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.session-time-main {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.session-timezone {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.session-status {
  font-size: 0.78rem;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.2);
}

.dot-closed {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.2);
}

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

.session .footer-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.side-panel {
  position: relative;
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 16px 16px 14px;
  background: radial-gradient(circle at top right, #111827 0, #020617 55%);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.side-panel::before {
  content: "";
  position: absolute;
  bottom: -140px;
  left: -120px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.2), transparent);
  opacity: 0.55;
  pointer-events: none;
}

.side-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.side-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.side-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.badge {
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--text-muted);
}

/* Live signal panel */

#signal-panel {
  margin-top: 16px;
}

.signal-card {
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: radial-gradient(circle at top left, #020617 0, #020617 55%);
  padding: 12px 14px 10px;
  box-shadow: var(--shadow-soft);
}

.signal-card-empty {
  opacity: 0.9;
}

.signal-header {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.signal-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.signal-item {
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.signal-item-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.signal-pair {
  font-size: 0.82rem;
  font-weight: 600;
}

.signal-sentiment {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: capitalize;
}

.signal-sentiment-bullish {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.7);
}

.signal-sentiment-bearish {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.7);
}

.signal-sentiment-neutral {
  background: rgba(148, 163, 184, 0.14);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.signal-meta {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.signal-source {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.signal-empty-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

/* News panel styles */

.news-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-item-loading,
.news-item-empty {
  font-size: 0.84rem;
  color: var(--text-muted);
  padding: 12px;
  text-align: center;
  border-radius: var(--border-radius-sm);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.news-item {
  border-radius: var(--border-radius-sm);
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.35);
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.news-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.55);
}

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

.news-source {
  display: flex;
  align-items: center;
  gap: 6px;
}

.source-icon {
  font-size: 0.9rem;
}

.source-name {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.news-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.news-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.4;
}

.news-summary {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.news-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.news-sentiment {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.news-sentiment.bullish {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.7);
}

.news-sentiment.bearish {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.7);
}

.sentiment-icon {
  font-size: 0.85rem;
}

.sentiment-confidence {
  opacity: 0.8;
  margin-left: 2px;
}

.news-pairs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
}

.pairs-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pairs-list {
  color: var(--text-main);
  font-weight: 500;
}

/* Sentiment Matrix Styles */
.sentiment-matrix-container {
  margin: 12px 0;
  /* overflow-x: auto; Removed to prevent scrollbar */
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.5);
}

.sentiment-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem; /* Slightly smaller font to fit */
  /* min-width: 600px; Removed min-width */
  table-layout: fixed; /* Force equal column widths */
}

.sentiment-matrix th,
.sentiment-matrix td {
  padding: 6px 4px; /* Reduced padding */
  text-align: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  overflow: hidden; /* Prevent overflow */
}

.sentiment-matrix th:last-child,
.sentiment-matrix td:last-child {
  border-right: none;
}

.sentiment-matrix tr:last-child td {
  border-bottom: none;
}

.sentiment-matrix th {
  background: rgba(30, 41, 59, 0.5);
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em; /* Tighter spacing */
  font-size: 0.65rem; /* Smaller header font */
}

.sentiment-matrix .model-col {
  text-align: left;
  width: 80px; /* Fixed width for model name */
  /* position: sticky; Removed sticky */
  /* left: 0; */
  /* background: rgba(15, 23, 42, 0.95); */
  /* z-index: 1; */
}

.sentiment-matrix .model-name {
  text-align: left;
  font-weight: 600;
  color: #e2e8f0;
  /* position: sticky; Removed sticky */
  /* left: 0; */
  /* background: rgba(15, 23, 42, 0.95); */
  /* z-index: 1; */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile optimizations for matrix */
@media (max-width: 640px) {
  .sentiment-matrix th, 
  .sentiment-matrix td {
    padding: 2px 1px !important; /* Minimal padding */
  }
  
  .sentiment-matrix th {
    font-size: 0.55rem !important; /* Tiny header */
    letter-spacing: 0 !important;
  }
  
  .sentiment-matrix .model-col,
  .sentiment-matrix .model-name {
    width: 50px !important; /* Shrink model name column */
    font-size: 0.6rem !important;
  }
  
  .cell-val {
    font-size: 0.55rem !important; /* Tiny values */
  }
  
  .cell-bar-bg {
    height: 3px !important; /* Thinner bars */
    max-width: 25px !important; /* Shorter bars */
  }
  
  /* Hide "OpenAI" / "Gemini" text, show icons only if needed, 
     but here we just truncate heavily */
  .model-name {
    max-width: 50px;
    overflow: hidden;
    text-overflow: clip; 
  }
}

.matrix-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px; /* Tighter gap */
}

.cell-val {
  font-weight: 700;
  font-size: 0.65rem; /* Smaller value font */
  white-space: nowrap;
}

.matrix-cell.bullish .cell-val { color: #22c55e; }
.matrix-cell.bearish .cell-val { color: #ef4444; }
.matrix-cell.neutral .cell-val { color: #94a3b8; }

.cell-bar-bg {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  max-width: 40px;
}

.cell-bar-fill {
  height: 100%;
  border-radius: 2px;
}

.news-reasoning {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}
