:root {
  --bg: #f4efe7;
  --panel: rgba(255, 250, 242, 0.82);
  --panel-border: rgba(72, 43, 13, 0.14);
  --text: #2d2118;
  --muted: #7b6856;
  --accent: #c35f2d;
  --accent-soft: rgba(195, 95, 45, 0.12);
  --grid: rgba(72, 43, 13, 0.12);
  --gain: 25, 135, 84;
  --loss: 191, 61, 52;
  --neutral: 109, 107, 104;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(233, 157, 112, 0.22), transparent 32%),
    radial-gradient(circle at top right, rgba(78, 134, 125, 0.18), transparent 28%),
    linear-gradient(180deg, #f7f2eb 0%, var(--bg) 100%);
}

code,
.control,
.chart-axis text,
.matrix-table {
  font-family: "IBM Plex Mono", monospace;
}

.dashboard-shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero-panel,
.panel,
.stat-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 16px 40px rgba(71, 46, 17, 0.08);
  backdrop-filter: blur(14px);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 24px;
  padding: 28px;
  border-radius: 28px;
}

.eyebrow,
.panel-kicker,
.meta-label,
.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy h1,
.panel-header h2 {
  margin: 8px 0 0;
  line-height: 1;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 6vw, 4.25rem);
}

.hero-text {
  max-width: 58ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.hero-meta {
  display: grid;
  gap: 16px;
}

.meta-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(72, 43, 13, 0.08);
}

.control {
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  color: var(--text);
  background: #fffdf8;
  border: 1px solid rgba(72, 43, 13, 0.16);
  border-radius: 14px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.stat-card {
  padding: 20px;
  border-radius: 22px;
}

.stat-value {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1;
}

.stat-context,
.panel-note,
.empty-state p {
  color: var(--muted);
  line-height: 1.55;
}

.panel {
  margin-top: 16px;
  padding: 22px;
  border-radius: 26px;
}

.panel-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.chart-wrap {
  min-height: 360px;
  overflow-x: auto;
}

.trend-svg {
  display: block;
  width: 100%;
  min-width: 760px;
}

.axis-label {
  fill: var(--muted);
  font-size: 11px;
}

.grid-line {
  stroke: var(--grid);
  stroke-width: 1;
}

.trend-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-point {
  fill: white;
  stroke: var(--accent);
  stroke-width: 3;
}

.trend-point-group {
  cursor: pointer;
}

.trend-point-group:focus {
  outline: none;
}

.trend-tooltip-text {
  display: none;
  fill: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  paint-order: stroke;
  stroke: #fffaf4;
  stroke-width: 6px;
  stroke-linejoin: round;
  pointer-events: none;
}

.trend-point-group:hover .trend-tooltip-text,
.trend-point-group:focus .trend-tooltip-text {
  display: block;
}

.trend-point-group:hover .trend-point,
.trend-point-group:focus .trend-point {
  fill: var(--accent);
}

.matrix-wrap {
  overflow: auto;
}

.matrix-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
}

.matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fcf7f0;
}

.matrix-table th,
.matrix-table td {
  padding: 10px 12px;
  border-right: 1px solid rgba(72, 43, 13, 0.08);
  border-bottom: 1px solid rgba(72, 43, 13, 0.08);
  text-align: center;
}

.matrix-table th:first-child,
.matrix-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 180px;
  text-align: left;
  background: #fffaf4;
}

.matrix-table thead th:first-child {
  z-index: 3;
}

.scene-name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.commit-label {
  min-width: 124px;
}

.commit-label strong,
.commit-label span {
  display: block;
}

.commit-label span {
  color: var(--muted);
  font-size: 0.76rem;
}

.matrix-cell {
  font-variant-numeric: tabular-nums;
  min-width: 132px;
  vertical-align: top;
}

.matrix-value {
  font-size: 0.96rem;
  font-weight: 500;
}

.matrix-camera-meta {
  margin-top: 6px;
  display: grid;
  gap: 2px;
  color: var(--muted);
  justify-items: center;
  font-size: 0.75rem;
}

.matrix-camera-count {
  white-space: nowrap;
}

.matrix-camera-delta {
  font-size: 0.96rem;
  line-height: 1.1;
  font-weight: 700;
}

.matrix-camera-delta.is-up {
  color: rgb(var(--gain));
}

.matrix-camera-delta.is-down {
  color: rgb(var(--loss));
}

.matrix-camera-delta.is-neutral {
  color: var(--muted);
}

.empty-state {
  text-align: center;
}

@media (max-width: 900px) {
  .hero-panel,
  .summary-grid,
  .panel-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .panel-header {
    align-items: start;
  }
}
