:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --panel: #151b22;
  --panel-2: #1e252d;
  --line: #2f3944;
  --text: #f6f8fb;
  --muted: #9aa8b5;
  --accent: #f0b90b;
  --accent-2: #46d4a3;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(240, 185, 11, 0.08), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 48px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 0.95;
}

h2 {
  font-size: 18px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(21, 27, 34, 0.78);
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.follow-link,
.note-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--text);
  color: #0b0f14;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}

.status.live .dot {
  background: var(--accent-2);
  box-shadow: 0 0 0 5px rgba(70, 212, 163, 0.12);
}

.status.error .dot {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(255, 107, 107, 0.12);
}

.campaign-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 12px;
  padding: 22px 28px;
  border: 1px solid rgba(70, 212, 163, 0.24);
  border-radius: 8px;
  background: rgba(21, 27, 34, 0.78);
}

.campaign-note p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.muted-line {
  font-size: 14px;
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.note-actions a:first-child {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.group-button {
  min-width: auto;
  min-height: 36px;
  padding: 8px 12px;
  background: var(--accent-2);
  color: #03140f;
  font-size: 14px;
}

.metric-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 218px;
  padding: 32px;
  border: 1px solid rgba(240, 185, 11, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(240, 185, 11, 0.18), rgba(70, 212, 163, 0.07)),
    var(--panel);
}

.metric-label,
.metric-subtitle {
  color: var(--muted);
}

.metric-label {
  font-size: 15px;
}

.metric-value {
  margin: 12px 0 10px;
  font-variant-numeric: tabular-nums;
  font-size: clamp(44px, 9vw, 92px);
  font-weight: 800;
  line-height: 0.95;
}

button {
  flex: 0 0 auto;
  min-width: 118px;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #151200;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

article,
.chart-wrap,
.details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 27, 34, 0.86);
}

article {
  min-width: 0;
  padding: 18px;
}

article span,
dt {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

article a,
article strong,
dd {
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 700;
}

.chart-wrap {
  margin-top: 12px;
  padding: 20px;
}

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

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

canvas {
  width: 100%;
  height: 280px;
  display: block;
  touch-action: none;
  border-radius: 6px;
  background: var(--panel-2);
}

.details {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: 24px;
  margin-top: 12px;
  padding: 22px;
}

.details p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0;
}

dd {
  margin: 0;
}

.qr-dialog {
  width: min(92vw, 520px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.qr-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.qr-panel {
  padding: 18px;
}

.qr-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.qr-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.icon-button {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.qr-panel img {
  display: block;
  width: 100%;
  max-height: min(72vh, 720px);
  object-fit: contain;
  border-radius: 6px;
  background: #111;
}

@media (max-width: 860px) {
  .hero,
  .metric-band,
  .campaign-note,
  .details {
    flex-direction: column;
    display: flex;
    align-items: stretch;
  }

  .hero-actions,
  .note-actions {
    justify-content: flex-start;
  }

  .grid,
  dl {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding-top: 18px;
  }

  .hero {
    padding-top: 12px;
  }

  h1 {
    font-size: 42px;
  }

  .metric-band {
    min-height: 196px;
    padding: 22px;
  }

  .grid,
  dl {
    grid-template-columns: 1fr;
  }

  .metric-value {
    font-size: 48px;
  }
}
