* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #0f1115;
  color: #e6e8eb;
}
.topbar {
  background: #14171d;
  padding: 14px 24px;
  border-bottom: 1px solid #232831;
}
.brand {
  color: #e6e8eb;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.3px;
}
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}
h1 { margin: 0 0 8px 0; font-weight: 600; }
.muted { color: #8a93a3; }
.small { font-size: 13px; }
.back {
  color: #6ab0ff;
  text-decoration: none;
  font-size: 13px;
}
.back:hover { text-decoration: underline; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: #14171d;
  border-radius: 6px;
  overflow: hidden;
}
th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #232831;
  font-size: 14px;
}
th { background: #1a1e26; font-weight: 500; color: #b0b8c5; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: #e6e8eb; }
th[data-sort]::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0.3;
}
th.sort-asc::after  { border-bottom: 5px solid #e6e8eb; opacity: 1; }
th.sort-desc::after { border-top: 5px solid #e6e8eb; opacity: 1; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: #1a1e26; }
tbody tr { cursor: pointer; }
.up { color: #4ade80; }
.down { color: #f87171; }

.ticker-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 12px;
  margin-bottom: 16px;
}
.live { text-align: right; }
.live-price { font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; }
.live-delta { font-size: 14px; font-variant-numeric: tabular-nums; }

.controls {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.label { font-size: 13px; color: #8a93a3; margin-right: 8px; }
.tf-btn {
  background: #1a1e26;
  color: #b0b8c5;
  border: 1px solid #232831;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  margin-right: 4px;
}
.tf-btn:hover { border-color: #3a4150; color: #e6e8eb; }
.tf-btn.active { background: #2a3045; color: #e6e8eb; border-color: #3a4150; }
.ma-toggle { font-size: 13px; margin-right: 12px; color: #b0b8c5; cursor: pointer; }
.ma-toggle input { vertical-align: middle; margin-right: 4px; }
#maBox.disabled { opacity: 0.4; pointer-events: none; }

#priceChart { background: #14171d; border-radius: 6px; padding: 12px; margin-bottom: 24px; }

.signals h2 { font-size: 16px; font-weight: 500; margin-top: 24px; }
#signals { list-style: none; padding: 0; }
#signals li {
  background: #14171d;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 4px;
  border-left: 3px solid #6ab0ff;
}
#signals .src {
  font-size: 12px;
  color: #8a93a3;
  margin-bottom: 4px;
}
#signals a { color: #6ab0ff; text-decoration: none; font-weight: 500; }
#signals a:hover { text-decoration: underline; }
#signals .rationale { font-size: 13px; color: #b0b8c5; margin-top: 4px; }
#signals li.kind-tracked { border-left-color: #fbbf24; }
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 500;
}
.badge-pivot { background: #1e3a5c; color: #6ab0ff; }
.badge-tracked { background: #3a2e10; color: #fbbf24; }
.impact-up { background: #14391f; color: #4ade80; }
.impact-down { background: #3b1414; color: #f87171; }
.impact-unclear { background: #2a2e3a; color: #b0b8c5; }

.evidence {
  margin: 8px 0 0 0;
  padding: 8px 12px;
  border-left: 2px solid #3a4150;
  background: #0f1115;
  color: #b0b8c5;
  font-size: 13px;
  font-style: italic;
}

.del-btn {
  margin-top: 8px;
  background: transparent;
  color: #f87171;
  border: 1px solid #3b1414;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}
.del-btn:hover { background: #3b1414; }

td.actions { white-space: nowrap; }
td.actions .action { color: #6ab0ff; text-decoration: none; margin-right: 8px; }
td.actions .action:hover { text-decoration: underline; }
td.actions .action-del {
  background: transparent;
  border: none;
  color: #8a93a3;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
td.actions .action-del:hover { color: #f87171; }

section { margin-bottom: 32px; }

.track-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 12px 0 16px 0;
  flex-wrap: wrap;
}
.track-form input[type="text"] {
  background: #14171d;
  border: 1px solid #232831;
  color: #e6e8eb;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  flex: 1;
  min-width: 220px;
  font-family: inherit;
}
.track-form input[type="text"]:focus {
  outline: none;
  border-color: #6ab0ff;
}
.track-form button {
  background: #2a3045;
  color: #e6e8eb;
  border: 1px solid #3a4150;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}
.track-form button:hover { border-color: #6ab0ff; }
