:root {
  color-scheme: light dark;
  --bg: #0f1216;
  --surface: #171b21;
  --border: #2a2f38;
  --text: #e6e9ee;
  --text-dim: #9aa4b2;
  --green: #3ecf6f;
  --red: #e5544d;
  --grey: #6b7280;
  --amber: #e0a72e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
}

h1 {
  font-size: 1.4rem;
  margin: 0;
}

.meta {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.add-ticker {
  margin-left: auto;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
}

.add-ticker:hover {
  border-color: var(--text-dim);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

.ticker-cell {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.status-green { background: var(--green); }
.status-red { background: var(--red); }
.status-grey { background: var(--grey); }

.row-no-data {
  color: var(--text-dim);
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.75rem;
  margin-right: 4px;
  margin-bottom: 4px;
  color: #0f1216;
  max-width: 100%;
}

/* Gleiche 3-Farb-Logik wie bei den Telegram-Nachrichten: bearisch immer rot,
   bullisch + RVOL High/Extreme gruen, bullisch sonst gelb. */
.badge-bullish-strong { background: var(--green); }
.badge-bullish-weak { background: var(--amber); }
.badge-bearish { background: var(--red); }

.ticker-cell a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--text-dim);
}

.ticker-cell a:hover {
  border-bottom-style: solid;
}

.nr-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--text-dim);
  color: var(--text-dim);
  vertical-align: middle;
}

table {
  table-layout: fixed;
}

th:nth-child(1), td:nth-child(1) { width: 16%; }
th:nth-child(2), td:nth-child(2) { width: 16%; }
th:nth-child(3), td:nth-child(3) { width: 18%; }
th:nth-child(4), td:nth-child(4) { width: 50%; }

.signal-cell {
  text-align: center;
}

.signal-details {
  display: inline-block;
  position: relative;
}

.signal-details summary {
  list-style: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  line-height: 0;
}

.signal-details summary::-webkit-details-marker,
.signal-details summary::marker {
  display: none;
  content: "";
}

.signal-details summary:hover {
  background: var(--border);
}

.signal-details[open] summary {
  background: var(--border);
}

.status-dot-lg {
  width: 16px;
  height: 16px;
  margin-right: 0;
}

.signal-detail-panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  text-align: left;
  font-size: 0.85rem;
  white-space: nowrap;
  max-width: min(65vw, 210px);
}

.signal-detail-row {
  padding: 2px 0;
}

.signal-detail-row .status-dot {
  margin-right: 6px;
}

.empty-note {
  color: var(--text-dim);
}

@media (max-width: 480px) {
  body { padding: 12px; }
  th, td { padding: 8px; font-size: 0.85rem; }
  h1 { font-size: 1.2rem; }
  .badge { font-size: 0.7rem; padding: 2px 6px; }
}
