.live-dashboard {
  --dash-card: var(--paper, #fff);
  --dash-text: var(--ink, #1f2937);
  --dash-muted: var(--muted, #6b7280);
  --dash-primary: var(--accent, #1f4e79);
  --dash-link: var(--link, #2563eb);
  --dash-line: #e5eaf0;
  display: grid;
  gap: 16px;
  min-width: 0;
  color: var(--dash-text);
  font-size: 14px;
  line-height: 1.5;
}

.live-dash-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--dash-line);
  border-radius: 12px;
  background: var(--dash-card);
}

.live-dash-kpis,
.live-kpi-grid {
  display: grid;
  gap: 16px;
}

.live-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr));
}

.live-kpi {
  min-height: 124px;
}

.live-kpi > span,
.live-kpi-note {
  display: block;
  color: var(--dash-muted);
  font-size: 12px;
}

.live-kpi > strong {
  display: block;
  margin-block: 4px;
  color: var(--dash-primary);
  font-size: 28px;
  font-weight: 750;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.live-kpi-change {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
  flex-wrap: wrap;
  color: var(--dash-muted);
  font-size: 12px;
  font-weight: 600;
}

.live-kpi-change[data-trend="up"] { color: #15803d; }
.live-kpi-change[data-trend="down"] { color: #b91c1c; }
.live-kpi-change span { color: var(--dash-muted); font-weight: 400; }
.live-kpi-note { margin-top: 3px; }

.live-kpi-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
}

.live-kpi-secondary a {
  display: inline-flex;
  gap: 7px;
  padding: 3px 0;
  color: var(--dash-muted);
  font-size: 12px;
  text-decoration: none;
}

.live-kpi-secondary a:hover,
.live-kpi-secondary a:focus-visible { text-decoration: underline; }
.live-kpi-secondary strong { color: var(--dash-primary); }

.live-dash-middle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: start;
}

.live-dash-card-heading,
.live-dash-queue header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.live-dash-card-heading {
  margin-bottom: 13px;
}

.live-dash-card-heading h2 {
  margin: 0;
  color: var(--dash-text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.live-dash-card-heading p,
.live-dash-empty p {
  margin: 3px 0 0;
  color: var(--dash-muted);
  font-size: 12px;
}

.live-dash-empty {
  display: grid;
  justify-items: center;
  padding: 22px 8px;
  color: var(--dash-muted);
  text-align: center;
}

.live-dash-empty svg { margin-bottom: 6px; color: #8096b2; }
.live-dash-empty strong { color: var(--dash-text); }

.live-dash-timeline,
.live-dash-queue ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.live-dash-timeline li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--dash-line);
}

.live-dash-timeline time { color: var(--dash-primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.live-dash-timeline small,
.live-dash-queue small { display: block; margin-top: 2px; color: var(--dash-muted); font-size: 12px; overflow-wrap: anywhere; }

.live-dash-row-link,
.live-dash-more {
  color: var(--dash-primary);
  font-weight: 650;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.live-dash-row-link:hover,
.live-dash-more:hover { color: var(--dash-link); text-decoration: underline; }

.live-dash-state {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
}

.live-dash-state[data-tone="success"] { background: #ecfdf3; color: #15803d; }
.live-dash-state[data-tone="warning"] { background: #fff7e6; color: #92400e; }
.live-dash-state[data-tone="info"] { background: #eff8ff; color: #0369a1; }
.live-dash-state[data-tone="danger"] { background: #fef2f2; color: #b91c1c; }

.live-chart-period,
.live-dash-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.live-chart-period .button {
  min-height: 30px;
  padding: 4px 9px;
  white-space: nowrap;
  font-size: 12px;
}

.live-dash-chart-body h3,
.live-dash-queue h3 { margin: 0 0 5px; color: var(--dash-text); font-size: 14px; font-weight: 650; }
.live-dash-roi { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--dash-line); }
.live-dash-chart { display: block; width: 100%; height: auto; }
.live-dash-chart text { fill: var(--dash-muted); font-size: 10px; }
.live-chart-grid { stroke: #e5eaf0; stroke-width: 1; }
.live-chart-line { fill: none; stroke: #2563eb; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.live-chart-area { fill: #eaf2ff; }
.live-chart-point { fill: #2563eb; }
.live-chart-bar { fill: #93c5fd; }

.live-dash-queues {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr));
  gap: 16px;
}

.live-dash-queue {
  min-width: 0;
  padding: 11px 12px;
  border-radius: 8px;
  background: #f8fafc;
}

.live-dash-queue header > span {
  padding: 0 7px;
  border-radius: 999px;
  background: #eaf1f8;
  color: var(--dash-primary);
  font-size: 12px;
  font-weight: 700;
}

.live-dash-queue li { padding: 7px 0; border-bottom: 1px solid var(--dash-line); }
.live-dash-queue-empty { margin: 6px 0; color: var(--dash-muted); font-size: 12px; }
.live-dash-more { display: inline-block; margin-top: 8px; font-size: 12px; }

@media (max-width: 900px) {
  .live-dash-middle { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 420px) {
  .live-dash-card { padding: 15px; }
  .live-kpi-grid { gap: 10px; }
  .live-dash-card-heading { flex-wrap: wrap; }
}
