body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; margin: 0; padding: 0; overflow-x: hidden; font-size: 11px; }
/* Main navigation tabs */
.main-tabs {
  display: flex;
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  padding: 0 20px;
  gap: 5px;
}

.main-tab-btn {
  background: none;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6c757d;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.main-tab-btn:hover {
  color: #0b3d91;
  background: rgba(11, 61, 145, 0.05);
}

.main-tab-btn.active {
  color: #0b3d91;
  border-bottom-color: #0b3d91;
  background: white;
}

.main-tab-content {
  display: none !important;
}

.main-tab-content.active {
  display: block !important;
}

/* ===== ALERTS TAB STYLING ===== */
.alerts-container {
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
  width: 66.666%;
}

@media (max-width: 1200px) {
  .alerts-container { width: 100%; }
}

/* Scan Controls */
.alerts-scan-section {
  text-align: center;
  margin-bottom: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
}

.scan-btn-large {
  background: linear-gradient(135deg, #0b3d91 0%, #1e5bb8 100%);
  color: white;
  border: none;
  padding: 15px 40px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(11, 61, 145, 0.3);
  transition: all 0.2s ease;
}

.scan-btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(11, 61, 145, 0.4);
}

.scan-btn-large:active {
  transform: translateY(0);
}

.scan-info {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: #6c757d;
}

#scan-progress {
  font-weight: 500;
  color: #0b3d91;
}

.scan-status {
  font-size: 12px;
}

.scan-status.scanning { color: #0b3d91; }
.scan-status.complete { color: #28a745; }
.scan-status.error { color: #dc3545; }

/* Summary Cards */
.scan-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.summary-card {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  transition: all 0.2s ease;
}

.summary-card:hover {
  border-color: #0b3d91;
  box-shadow: 0 2px 8px rgba(11, 61, 145, 0.1);
}

.summary-card.momentum {
  border-color: #17a2b8;
}

.summary-card.trend {
  border-color: #ffc107;
}

.summary-label {
  font-size: 11px;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.summary-value {
  font-size: 28px;
  font-weight: bold;
  color: #0b3d91;
}

.summary-card.momentum .summary-value {
  color: #17a2b8;
}

.summary-card.trend .summary-value {
  color: #ffc107;
}

/* Alerts Sections */
.alerts-sections {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.alerts-section {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  width: 100%; /* fill alerts-container width */
}

/* Responsive fallback: on narrower screens use full width */
@media (max-width: 1200px) {
  .alerts-container { width: 100%; }
}

.alerts-section h3 {
  margin: 0 0 15px 0;
  font-size: 18px;
  color: #0b3d91;
  border-bottom: 2px solid #dee2e6;
  padding-bottom: 10px;
}

.momentum-section h3 {
  color: #17a2b8;
  border-bottom-color: #17a2b8;
}

.trend-section h3 {
  color: #ffc107;
  border-bottom-color: #ffc107;
}

/* Momentum Subsections */
.momentum-subsections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.subsection {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 15px;
  background: #f8f9fa;
}

.subsection h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #495057;
  font-weight: 600;
}

/* Alerts Grid */
.alerts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.no-alerts {
  grid-column: 1 / -1;
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 30px;
  font-size: 13px;
}

/* Alert Cards */
.alert-card {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 3px;
  padding: 3px 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 66%;
}

.alert-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.alert-card.bullish {
  border-color: #28a745;
  background: linear-gradient(135deg, #ffffff 0%, #f0fff4 100%);
}

.alert-card.bearish {
  border-color: #dc3545;
  background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
}

.alert-icon {
  font-size: 12px;
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
  min-width: 0;
}

.alert-symbol {
  font-size: 10px;
  font-weight: bold;
  color: #0b3d91;
  margin-bottom: 1px;
  line-height: 1.2;
}

.alert-rule {
  font-size: 10px;
  color: #000000;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.alert-value {
  font-size: 10px;
  font-weight: 600;
  color: #000000;
  line-height: 1.2;
}

.alert-card.bullish .alert-symbol {
  color: #28a745;
}

.alert-card.bearish .alert-symbol {
  color: #dc3545;
}

/* Stock-Grouped Alerts Styling */
.stock-grouped-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: none;
  width: 100%;
}

.stock-alerts-group {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  overflow: hidden;
}

.stock-group-header {
  background: linear-gradient(135deg, #0b3d91 0%, #1e5bb8 100%);
  color: white;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.stock-group-header .stock-symbol {
  font-size: 14px;
  letter-spacing: 0.5px;
}

.stock-group-header .alert-count {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 10px;
}

.stock-alerts-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stock-alert-item {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 3px;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.stock-alert-item:hover {
  transform: translateX(2px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stock-alert-item.bullish {
  border-left: 3px solid #28a745;
  background: linear-gradient(90deg, #f0fff4 0%, #ffffff 100%);
}

.stock-alert-item.bearish {
  border-left: 3px solid #dc3545;
  background: linear-gradient(90deg, #fff5f5 0%, #ffffff 100%);
}

.stock-alert-item.neutral {
  border-left: 3px solid #6c757d;
  background: linear-gradient(90deg, #f8f9fa 0%, #ffffff 100%);
}

.alert-rule-name {
  font-size: 12px;
  color: #000000;
  font-weight: 500;
  flex: 1;
}

.alert-explanation {
  font-size: 10px;
  color: #6c757d;
  font-style: italic;
  margin-left: 8px;
  font-weight: 400;
}

.stock-alert-item .alert-value {
  font-size: 11px;
  font-weight: 600;
  color: #495057;
  white-space: nowrap;
  margin-left: 8px;
}

/* Fundamentals section styling */
.fundamentals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-bottom: 4px;
}

.fundamentals-section {
  background: #f8f9fa;
  border-radius: 4px;
  padding: 1px;
}

.fundamentals-section.wide-card {
  grid-column: 1 / -1;
  padding: 4px;
}

.fundamentals-section.wide-card h4 {
  margin-bottom: 6px;
  font-size: 12px;
  white-space: normal;
}

.fundamentals-section.wide-card .content-wrapper {
  display: block;
  white-space: nowrap;
  font-size: 0;
}

.fundamentals-section.wide-card .analysis-compact {
  display: inline-block;
  width: 23%;
  margin-right: 2%;
  vertical-align: top;
  font-size: 9px;
  white-space: normal;
}

.fundamentals-section h4 {
  margin: 0 0 3px 0;
  font-size: 11px;
  color: #0b3d91;
  font-weight: 600;
}

.fundamentals-summary {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 4px;
  padding: 8px;
  text-align: center;
  border: 1px solid #dee2e6;
}

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

.rating-indicator {
  font-size: 12px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 3px;
  background: #e9ecef;
  color: #495057;
}

.rating-indicator.strong-buy { background: #d4edda; color: #155724; }
.rating-indicator.buy { background: #d1ecf1; color: #0c5460; }
.rating-indicator.hold { background: #fff3cd; color: #856404; }
.rating-indicator.sell { background: #f8d7da; color: #721c24; }

.category-indicator {
  font-size: 10px;
  color: #6c757d;
  font-weight: 500;
}

.fundamentals-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #6c757d;
}

.fundamentals-score {
  font-weight: 500;
}

.risk {
  font-weight: 500;
}

.risk.low { color: #28a745; }
.risk.medium { color: #ffc107; }
.risk.high { color: #dc3545; }

/* Header styling */
header { 
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); 
  color: white; 
  padding: 2px 8px; 
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  border-bottom: 1px solid #1a365d;
  position: relative;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-icon {
  font-size: 16px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.app-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  background: linear-gradient(45deg, #ffffff, #e0e6ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-subtitle {
  font-size: 10px;
  opacity: 0.85;
  font-style: italic;
  color: #b8d4ff;
}

.app-version {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}

.app-version:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
#main-wrap { padding: 6px; }
main { min-width: 0; }
#dashboard-tab.active { display: grid !important; grid-template-columns: 1fr 260px; gap: 8px; min-width: 0; align-items: start; }

/* Controls - Compact Professional Layout */
#controls { 
  padding: 4px; 
  background: #f8f9fa; 
  border-radius: 3px; 
  margin-bottom: 4px; 
  font-size: 9px;
  border: 1px solid #e9ecef;
}

/* Control Sections - Compact Rows */
.control-section {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-bottom: 2px;
  justify-content: flex-start;
  width: auto;
  height: auto;
}

.control-section:last-child {
  margin-bottom: 0;
}

/* Control Groups - Compact containers */
.control-group {
  display: flex;
  flex-direction: row;
  gap: 2px;
  align-items: center;
  min-width: 0;
}

.control-group:nth-child(2) {
  margin-left: 20px;
}

.control-group:nth-child(3) {
  margin-left: 20px;
}

/* Second row spacing */
.control-section:nth-child(2) .control-group:nth-child(2) {
  margin-left: 10px;
}

.control-group.full-width {
  flex: 1;
  width: 100%;
}

.control-group.tooltip-control {
  margin-left: auto;
  margin-right: 0;
}

.control-group label {
  font-weight: 600;
  color: #495057;
  font-size: 9px;
  margin: 0;
  white-space: nowrap;
}

/* Button Groups */
.button-group {
  display: flex;
  gap: 2px;
}

/* Period and Timeframe buttons */
.period-btn, .timeframe-btn {
  padding: 2px 4px;
  border: 1px solid #dee2e6;
  background: #fff;
  border-radius: 2px;
  cursor: pointer;
  font-size: 9px;
  transition: all 0.2s ease;
  color: #495057;
}

.period-btn:hover, .timeframe-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.period-btn.active, .timeframe-btn.active {
  background: #0d6efd;
  color: white;
  border-color: #0d6efd;
}

/* Checkbox Grid for Moving Averages - Single Row */
.checkbox-grid {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  width: 100%;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 1px 3px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 2px;
  transition: all 0.2s ease;
  font-size: 9px;
}

.checkbox-item:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

.checkbox-item input[type="checkbox"] {
  margin: 0;
  transform: scale(0.8);
}

.checkbox-item label {
  margin: 0;
  font-size: 9px;
  font-weight: normal;
  color: #495057;
  cursor: pointer;
}

/* Compact Indicator Controls - Single Row */
.indicator-controls {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-wrap: wrap;
  width: auto;
}

.indicator-box {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  padding: 2px 2px 2px 4px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 2px;
  transition: all 0.2s ease;
  margin: 0 1px;
  width: auto;
  flex: none;
}

.indicator-box:hover {
  border-color: #0d6efd;
  box-shadow: 0 1px 2px rgba(13, 110, 253, 0.1);
}

.indicator-box input[type="checkbox"] {
  margin: 0;
  transform: scale(0.8);
}

.indicator-box label {
  margin: 0;
  font-size: 9px;
  font-weight: 600;
  color: #495057;
  cursor: pointer;
  white-space: nowrap;
}

.indicator-box select {
  padding: 1px 3px;
  font-size: 9px;
  border: 1px solid #ced4da;
  border-radius: 2px;
  background: #fff;
  color: #495057;
  min-width: 32px;
  width: auto;
}

.indicator-box select:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.25);
}

/* Input styling */
#symbol {
  padding: 2px 4px;
  font-size: 9px;
  border: 1px solid #ced4da;
  border-radius: 2px;
  background: #fff;
  min-width: 50px;
}

#symbol:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.25);
}

/* Button styling */
button {
  padding: 2px 4px;
  font-size: 9px;
  border: 1px solid #0d6efd;
  background: #0d6efd;
  color: white;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  background: #0b5ed7;
  border-color: #0b5ed7;
}

button:active {
  transform: translateY(1px);
}

/* Left column wrapper */
#left-column { 
  display: flex; 
  flex-direction: column; 
  gap: 4px; 
  width: 100%;
  min-width: 0;
}

/* Chart section */
#chart { 
  background: #f7f9fc; 
  padding: 4px; 
  overflow: visible; 
  min-width: 0; 
  border-radius: 3px; 
  width: 100%;
  box-sizing: border-box;
}

/* Chart row: svg + right axis */
#chart-row { display: flex; align-items: stretch; gap: 4px; margin-bottom: 8px; }
#chart-area { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; padding-bottom: 0px; position: relative; overflow: visible; }

/* Chart container */
#chart-container { 
  width: 100%; 
  min-height: 600px; 
  height: auto; /* Allow height to expand based on content */
  box-sizing: border-box; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  border: 1px solid #ddd; 
  border-radius: 3px; 
  background: #fff;
}
svg { display: block; max-width: 100%; }

/* Right axis container */
#right-axis { 
  width: 0px; 
  height: 400px; 
  box-sizing: border-box; 
  padding-left: 6px; 
  padding-top: 12px;
  padding-bottom: 20px;
  position: relative; 
}
#right-axis .tick { position: absolute; right: 6px; transform: translateY(-50%); font-size: 10px; color: #333; }

/* Bottom axis */
#bottom-axis { 
  width: 100%; /* Use full available width */
  height: 30px; 
  margin-top: 2px; 
  font-size: 12px; 
  color: #333; 
  position: absolute; 
  left: 0; /* Start from same position as SVG */
  bottom: -30px; 
  pointer-events: none; 
  z-index: 60; 
}
#bottom-axis > div {
  position: absolute;
  font-size: 9px;
  color: #555;
  pointer-events: none;
  white-space: nowrap;
}

/* Date labels */
.date-label {
  position: absolute;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 10px;
  color: #222;
  transform: translateX(-50%);
  z-index: 80;
  pointer-events: none;
  white-space: nowrap;
}

/* Indicator panes - full width of left column */
#indicator-panes { 
  margin-top: 8px; 
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  clear: both;
}
.indicator-pane { 
  background: #fff; 
  border: 1px solid #ddd; 
  border-radius: 3px; 
  margin-bottom: 3px; 
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  flex: none;
  display: block;
  position: relative;
}
.indicator-pane h4 { 
  margin: 0; 
  font-size: 9px; 
  color: #333;
  font-weight: 600;
  min-width: 60px;
  flex-shrink: 0;
  text-align: left;
}
.indicator-content {
  width: 100%;
  height: 80px;
  position: relative;
}
.indicator-pane svg { 
  width: 100%;
  height: 80px;
  background: #fafafa;
  border: none;
  display: block;
}

/* Indicator labels positioned on the right side */
.indicator-labels {
  position: absolute;
  right: 8px;
  top: 4px;
  font-size: 10px;
  color: #333;
  background: rgba(255,255,255,0.8);
  padding: 2px 4px;
  border-radius: 2px;
}
.indicator-title {
  font-weight: bold;
  margin-bottom: 2px;
}
.indicator-values {
  font-size: 9px;
  color: #666;
}

/* Sidebar */
/* Explicit width + flex-basis to ensure the alerts/side panel actually widens regardless of other flex/grid rules */
aside { background: #fff; border-left: 1px solid #eee; padding: 8px; width: 100%; max-width: none; flex: none; box-sizing: border-box; }
aside h2 { font-size: 16px; margin: 0 0 8px 0; color: #333; }
aside button { display: block; width: 100%; margin-bottom: 4px; padding: 6px; text-align: left; background: #f5f5f5; border: 1px solid #ddd; border-radius: 3px; cursor: pointer; }
aside button:hover { background: #e0e0e0; }

/* small tick mark under the chart */
.date-tick {
	position: absolute;
	/* top will be set inline from client.js to match the gridline y */
	width: 2px;
	height: 10px;
	background: #333;
	transform: translateX(-50%);
	z-index: 40;
}

/* faint vertical line for each date tick */
.date-vert {
	position: absolute;
	width: 2px;
	/* stronger, bluish guide for visibility during testing */
	background: rgba(11,61,145,0.12);
	border-left: 1px solid rgba(11,61,145,0.18);
	transform: translateX(-50%);
	z-index: 20;
	pointer-events: none;
}

#chart-container { width: 100%; height: 400px; box-sizing: border-box; display:block; }
#indicator-panes {
	display: flex;
	flex-direction: column;
	gap: 0px;
	margin-top: 8px;
	margin-bottom: 8px;
	min-height: 40px;
}

.indicator-pane { 
  margin: 0; 
  margin-bottom: 0; 
  padding: 0; 
  border: 1px solid #ddd; /* Restore border for visual separation */
  border-radius: 3px; 
  background: #fafafa; 
  font-size: 9px; 
  position: relative; 
  width: 100%;
  box-sizing: border-box;
}

/* Indicator timeframe select dropdowns */
select {
  background-color: #f5f5f5;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 9px;
  margin-right: 8px;
  margin-left: 2px;
}

select:focus {
  outline: none;
  border-color: #0b3d91;
}

/* Watchlist Styles */
.panel-section {
  margin-bottom: 8px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 6px;
}

.panel-section.compact {
  margin-bottom: 8px;
  padding-bottom: 6px;
}

.panel-section h3 {
  margin: 0;
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
}

.help-icon {
  font-size: 12px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.help-icon:hover {
  opacity: 1;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 5px;
}

.panel-header h3 {
  margin: 0;
  font-size: 14px;
  color: #333;
}

/* Compact Technical Analysis */
.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-bottom: 4px;
  width: 100%;
  box-sizing: border-box;
  align-items: start;
}

.analysis-mini-section {
  background: #f8f9fa;
  border-radius: 4px;
  padding: 0px;
  border: 1px solid #e9ecef;
  min-width: 0;
  overflow: hidden;
  word-wrap: break-word;
}

.analysis-mini-section h4 {
  margin: 0 0 1px 0;
  font-size: 10px;
  color: #495057;
  font-weight: 600;
}

.analysis-compact {
  display: flex;
  flex-direction: column;
  margin-bottom: 1px;
  font-size: 9px;
  line-height: 1.0;
}

.analysis-compact:last-child {
  margin-bottom: 0;
}

.label-mini {
  color: #6c757d;
  font-weight: 600;
  margin-bottom: 1px;
  font-size: 8px;
}

.value {
  color: #333;
  font-weight: 500;
  text-align: left;
  word-wrap: break-word;
  hyphens: auto;
  font-size: 10px;
}

/* Confluence Summary */
.confluence-summary {
  background: linear-gradient(135deg, #f1f3f4 0%, #e8eaed 100%);
  border-radius: 6px;
  padding: 6px;
  border: 1px solid #dadce0;
  margin-top: 2px;
}

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

.bias-indicator {
  font-weight: 700;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  text-align: center;
}

.strength-indicator {
  font-size: 9px;
  color: #5f6368;
  font-weight: 500;
}

.confluence-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
}

.confluence-score {
  color: #5f6368;
  font-weight: 500;
}

.confidence {
  font-weight: 600;
  color: #1a73e8;
}

.watchlist-controls {
  display: flex;
  align-items: center;
  gap: 1px;
}

#watchlist-selector {
  font-size: 8px;
  padding: 1px 2px;
  min-width: 60px;
  height: 18px;
}

.watchlist-controls button {
  padding: 0px 2px;
  font-size: 8px;
  border: 1px solid #ccc;
  border-radius: 2px;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 16px;
  height: 18px;
  line-height: 1;
}

.watchlist-controls button:hover {
  background: #e9ecef;
  border-color: #999;
}

#add-symbol-form {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 6px;
  padding: 6px;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

#add-symbol-form input {
  padding: 3px 5px;
  font-size: 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: white;
}

#add-symbol-form input:focus {
  outline: none;
  border-color: #0b3d91;
}

#add-symbol-btn {
  padding: 3px 6px;
  font-size: 10px;
  background: #0b3d91;
  color: white;
  border: 1px solid #0b3d91;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#add-symbol-btn:hover {
  background: #094a8a;
}

#watchlist-items {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: white;
}

.watchlist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1px 3px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.watchlist-item:hover {
  background: #f5f5f5;
}

.watchlist-item.active {
  background: #e3f2fd;
  border-left: 3px solid #0b3d91;
}

.watchlist-symbol {
  font-weight: bold;
  font-size: 9px;
  color: #0b3d91;
  min-width: 45px;
}

.watchlist-remarks {
  font-size: 9px;
  color: #666;
  flex: 1;
  margin-left: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watchlist-remove {
  font-size: 10px;
  color: #dc3545;
  cursor: pointer;
  opacity: 0.6;
  padding: 2px 4px;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.watchlist-remove:hover {
  opacity: 1;
  background: #f8d7da;
}

.empty-watchlist {
  padding: 12px;
  text-align: center;
  color: #999;
  font-size: 10px;
  font-style: italic;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  min-width: 300px;
  max-width: 500px;
}

.modal-content h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 14px;
}

.modal-content input {
  width: 100%;
  padding: 8px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 15px;
  box-sizing: border-box;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-buttons button {
  padding: 6px 12px;
  font-size: 11px;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-buttons button:first-child {
  background: #0b3d91;
  color: white;
  border-color: #0b3d91;
}

.modal-buttons button:first-child:hover {
  background: #094a8a;
}

.modal-buttons button:last-child {
  background: #f8f9fa;
  color: #333;
}

.modal-buttons button:last-child:hover {
  background: #e9ecef;
}

/* Drawing Tools Styles */
.drawing-tools {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  align-items: center;
}

.tool-btn {
  padding: 2px 6px;
  font-size: 9px;
  border: 1px solid #6c757d;
  background: #fff;
  color: #495057;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tool-btn:hover {
  background: #f8f9fa;
  border-color: #495057;
}

.tool-btn.active {
  background: #28a745;
  color: white;
  border-color: #28a745;
}

.drawing-actions {
  display: flex;
  gap: 3px;
  align-items: center;
}

.drawing-actions button {
  padding: 2px 6px;
  font-size: 9px;
  border: 1px solid #dc3545;
  background: #fff;
  color: #dc3545;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drawing-actions button:hover {
  background: #dc3545;
  color: white;
}

/* Drawing overlay styles */
.drawing-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.drawing-overlay.active {
  pointer-events: all;
  cursor: crosshair;
}

/* Drawing elements */
.drawing-element {
  stroke-width: 2;
  fill: none;
  pointer-events: stroke;
  cursor: pointer;
}

.drawing-element.trendline {
  stroke: #007bff;
}

.drawing-element.ray {
  stroke: #28a745;
}

.drawing-element.horizontal {
  stroke: #9c27b0;
  stroke-dasharray: 6,4;
}

.drawing-element.rectangle {
  stroke: #6f42c1;
  fill: rgba(111, 66, 193, 0.1);
}

.drawing-element.ray {
  stroke: #1976d2;
}

.drawing-element.fib-channel {
  stroke: #20c997;
}

.drawing-element:hover {
  stroke-width: 3;
  opacity: 0.8;
}

.drawing-element.selected {
  stroke-width: 3;
  stroke-dasharray: 3,3;
}

/* Fibonacci level labels */
.fib-label {
  font-size: 11px;
  font-family: Arial, sans-serif;
  font-weight: bold;
  pointer-events: none;
}

/* Technical Analysis Panel Styles */
#technical-analysis {
  font-size: 8px;
  background: #f8f9fa;
  border-radius: 6px;
  padding: 1px;
  margin-top: 0px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.analysis-section {
  margin-bottom: 5px;
  padding-bottom: 3px;
  border-bottom: 1px solid #e9ecef;
}

.analysis-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.analysis-section h4 {
  margin: 0 0 8px 0;
  font-size: 11px;
  color: #495057;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.analysis-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  font-size: 8px;
}

.analysis-item .label {
  color: #6c757d;
  font-weight: 500;
}

.analysis-item .value {
  font-weight: 600;
  text-align: right;
  padding: 1px 4px;
  border-radius: 3px;
  min-width: 45px;
}

/* Signal value color coding */
.value.bullish {
  background: #d4edda;
  color: #155724;
  font-size: 8px;
}

.value.bearish {
  background: #f8d7da;
  color: #721c24;
  font-size: 8px;
}

.value.neutral {
  background: #fff3cd;
  color: #856404;
  font-size: 8px;
}

.value.overbought {
  background: #f8d7da;
  color: #721c24;
  font-size: 8px;
}

.value.oversold {
  background: #d4edda;
  color: #155724;
  font-size: 8px;
}

/* Overall signal summary */
.signal-summary {
  text-align: center;
  padding: 8px;
  background: white;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

.sentiment {
  font-size: 12px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.sentiment.bullish {
  background: #28a745;
  color: white;
}

.sentiment.bearish {
  background: #dc3545;
  color: white;
}

.sentiment.neutral {
  background: #ffc107;
  color: #212529;
}

/* Additional Professional Analysis Classes */
.value.overbought {
  color: #e74c3c;
  font-weight: 600;
}

.value.oversold {
  color: #27ae60;
  font-weight: 600;
}

.bias-indicator.bullish {
  background: #28a745;
  color: white;
}

.bias-indicator.bearish {
  background: #dc3545;
  color: white;
}

.bias-indicator.neutral {
  background: #6c757d;
  color: white;
}

.confidence {
  font-size: 8px;
  color: #6c757d;
  font-weight: 500;
}

/* Alerts Panel Styles */
.alert-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.alert-btn {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 3px;
  padding: 2px 4px;
  cursor: pointer;
  font-size: 10px;
  transition: all 0.2s ease;
}

.alert-btn:hover {
  background: #e9ecef;
}

/* Progress scanning display */
.scan-progress {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 10px;
}

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

.progress-header h3 {
  margin: 0;
  color: #0b3d91;
  font-size: 14px;
}

.progress-percentage {
  font-weight: bold;
  color: #0b3d91;
  font-size: 14px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0b3d91, #1a4f9a);
  transition: width 0.3s ease;
  border-radius: 4px;
}

.progress-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.current-stock {
  font-size: 12px;
  color: #333;
}

.current-stock strong {
  color: #0b3d91;
  font-weight: bold;
}

.stock-desc {
  color: #6c757d;
  font-size: 10px;
  margin-left: 8px;
}

.stock-counter {
  font-size: 11px;
  color: #6c757d;
  font-weight: 500;
}

.next-stock {
  font-size: 10px;
  color: #6c757d;
  font-style: italic;
}

.next-stock strong {
  color: #495057;
}

/* Scan button styling */
.scan-btn {
  background: #0b3d91;
  color: white;
  padding: 6px 12px;
  margin-left: 5px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.scan-btn:hover:not(:disabled) {
  background: #1a4f9a;
  transform: translateY(-1px);
}

.scan-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
}

/* Alerts results styling */
.alerts-summary {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 10px;
}

.alerts-summary h3 {
  margin: 0 0 5px 0;
  color: #dc3545;
  font-size: 14px;
}

.alerts-summary p {
  margin: 0;
  color: #6c757d;
  font-size: 12px;
}

.no-alerts {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  padding: 10px;
  text-align: center;
}

.no-alerts h3 {
  margin: 0 0 5px 0;
  color: #155724;
  font-size: 14px;
}

.no-alerts p {
  margin: 0;
  color: #155724;
  font-size: 12px;
}

.alerts-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

.alert-item {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
}

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

.alert-symbol {
  font-weight: bold;
  color: #0b3d91;
  min-width: 60px;
  font-size: 12px;
}

.alert-message {
  flex: 1;
  margin: 0 10px;
  font-size: 11px;
  color: #333;
}

.alert-time {
  font-size: 10px;
  color: #6c757d;
  min-width: 60px;
  text-align: right;
}

.alerts-errors {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  padding: 8px;
  margin-top: 10px;
}

.alerts-errors h4 {
  margin: 0 0 5px 0;
  color: #856404;
  font-size: 12px;
}

.alerts-errors ul {
  margin: 0;
  padding-left: 15px;
  font-size: 10px;
  color: #856404;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #6c757d;
  font-style: italic;
  font-size: 12px;
}

.error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  padding: 10px;
  text-align: center;
}

.error h3 {
  margin: 0 0 5px 0;
  color: #721c24;
  font-size: 14px;
}

.error p {
  margin: 0;
  color: #721c24;
  font-size: 11px;
}

.alert-status {
  font-size: 8px;
  margin-left: 5px;
}

.alert-status.running {
  color: #28a745;
}

.alert-status.stopped {
  color: #dc3545;
}

.alert-status.loading {
  color: #ffc107;
}

#alerts-content {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 8px;
}

#alerts-list {
  font-size: 9px;
}

.alert-item {
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 4px;
  border-left: 3px solid #dee2e6;
  background: #f8f9fa;
}

.alert-item.loading {
  color: #6c757d;
  font-style: italic;
  text-align: center;
}

.alert-item.bullish {
  border-left-color: #28a745;
  background: #d4edda;
}

.alert-item.bearish {
  border-left-color: #dc3545;
  background: #f8d7da;
}

.alert-item.neutral {
  border-left-color: #ffc107;
  background: #fff3cd;
}

.alert-time {
  font-size: 8px;
  color: #6c757d;
  float: right;
}

.alert-message {
  font-weight: 500;
  margin-bottom: 2px;
}

.alert-symbol {
  font-weight: bold;
  color: #495057;
}

.empty-alerts {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 20px 10px;
  font-size: 9px;
}

/* Alerts Tab Styles */
.alerts-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
  border-bottom: 1px solid #dee2e6;
}

.tab-btn {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 9px;
  transition: all 0.2s ease;
  color: #495057;
}

.tab-btn:hover {
  background: #e9ecef;
}

.tab-btn.active {
  background: #fff;
  color: #0d6efd;
  border-color: #0d6efd;
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Alert Rule Styles */
.alert-rule-item {
  padding: 4px 6px;
  margin-bottom: 2px;
  border-radius: 3px;
  border: 1px solid #e9ecef;
  background: #fff;
  font-size: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-rule-item.enabled {
  border-left: 3px solid #28a745;
  background: #f8fff9;
}

.alert-rule-item.disabled {
  border-left: 3px solid #6c757d;
  background: #f8f9fa;
  opacity: 0.7;
}

.alert-rule-info {
  flex: 1;
}

.alert-rule-name {
  font-weight: 600;
  color: #495057;
  margin-bottom: 1px;
}

.alert-rule-description {
  color: #6c757d;
  font-size: 9px;
}

.alert-rule-toggle {
  font-size: 8px;
  padding: 1px 3px;
  border: 1px solid #dee2e6;
  border-radius: 2px;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.2s ease;
}

.alert-rule-toggle:hover {
  background: #e9ecef;
}

.alert-rule-toggle.enabled {
  background: #28a745;
  color: white;
  border-color: #28a745;
}

#alerts-rules-list {
  max-height: 180px;
  overflow-y: auto;
}