:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --panel: #ffffff;
  --panel-soft: #f0f3f5;
  --border: #d9dedc;
  --ink: #171b1d;
  --muted: #657071;
  --accent: #b43c2e;
  --accent-soft: #f6ded9;
  --blue: #2563a8;
  --green: #247a53;
  --shadow: 0 18px 48px rgba(29, 35, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--panel);
  font-weight: 800;
}

.brand-text strong {
  display: block;
  font-size: 15px;
}

.brand-text span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a,
.nav button,
.pill {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 8px 12px;
  text-decoration: none;
}

.nav a.active,
.pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--panel);
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.summary,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.summary {
  padding: 26px;
}

.chart-panel {
  display: flex;
  flex-direction: column;
  min-height: 398px;
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.chart-head h1 {
  font-size: clamp(30px, 4vw, 46px);
  margin-bottom: 10px;
}

.mention-chart {
  display: block;
  width: 100%;
  min-height: 260px;
  margin-top: auto;
  overflow: visible;
}

.chart-grid {
  stroke: var(--border);
  stroke-dasharray: 5 5;
  stroke-width: 1.2;
}

.price-line {
  fill: none;
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.2;
}

.mention-dot {
  fill: var(--accent);
  stroke: var(--panel);
  stroke-width: 2;
  opacity: 0.82;
}

.chart-axis-label,
.chart-date-label,
.chart-value-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-date-end {
  text-anchor: end;
}

.chart-value-label {
  fill: var(--ink);
  text-anchor: end;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(32px, 5vw, 58px);
  line-height: 0.94;
  margin: 10px 0 14px;
}

.lede {
  color: var(--muted);
  line-height: 1.62;
  max-width: 720px;
  margin: 0;
}

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--accent-soft);
  border-radius: 8px;
  background: #fff7f4;
  color: #713327;
  font-size: 13px;
  line-height: 1.5;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.metric {
  min-height: 95px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 26px;
}

.metrics .metric:last-child {
  grid-column: 1 / -1;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 0.86fr;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-head h2 {
  font-size: 16px;
  margin: 0;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.ticker-link {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.count {
  font-weight: 800;
}

.market-change {
  font-weight: 800;
}

.market-change.positive {
  color: var(--green);
}

.market-change.negative {
  color: var(--accent);
}

.market-change.neutral {
  color: var(--muted);
}

.source-badge {
  display: inline-flex;
  align-items: center;
  min-width: 42px;
  justify-content: center;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.post-list {
  display: grid;
  gap: 0;
}

.post {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.post:last-child {
  border-bottom: 0;
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.post p {
  margin: 0;
  line-height: 1.58;
}

.post a {
  color: var(--blue);
  display: inline-block;
  font-size: 13px;
  margin-top: 10px;
  text-decoration: none;
}

.history-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.empty {
  color: var(--muted);
  padding: 24px 20px;
}


@media (max-width: 860px) {
  .topbar,
  .hero,
  .grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding-top: 14px;
  }

  .summary {
    padding: 20px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 11px 12px;
  }

  .hide-sm {
    display: none;
  }
}
