:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe3ef;
  --green: #047857;
  --red: #dc2626;
  --amber: #b45309;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}
a { color: inherit; }
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.brand { font-weight: 700; text-decoration: none; }
.topbar nav { display: flex; gap: 14px; font-size: 14px; color: var(--muted); }
.topbar nav a { text-decoration: none; }
.readonly { margin-left: auto; color: var(--muted); font-size: 12px; }
main { max-width: 1180px; margin: 0 auto; padding: 18px; }
.hero { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.hero h1 { margin: 0; font-size: 24px; }
.hero p { margin: 6px 0 0; color: var(--muted); }
.snapshot-banner {
  align-self: flex-start;
  max-width: 340px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
}
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.label { color: var(--muted); font-size: 12px; }
.value { margin-top: 4px; font-size: 20px; font-weight: 700; }
.section { margin-top: 18px; }
.section h2 { font-size: 16px; margin: 0 0 10px; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
th { color: var(--muted); font-weight: 600; background: #fbfdff; }
tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 2px 7px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: 12px; }
.buy, .bullish { color: var(--green); font-weight: 700; }
.sell, .bearish { color: var(--red); font-weight: 700; }
.hold, .neutral { color: var(--muted); font-weight: 700; }
.warn { color: var(--amber); }
.chart-wrap { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
canvas { width: 100%; min-height: 380px; display: block; }
.sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.small { color: var(--muted); font-size: 12px; }
.error-list { color: var(--red); font-size: 13px; }
@media (max-width: 700px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 12px; gap: 8px; }
  .readonly { margin-left: 0; }
  .hero { flex-direction: column; }
  th, td { padding: 8px; font-size: 12px; }
}
