/* Today block (session 53). Prefix: analytics-today. Linked from index.html after styles.css. */

.analytics-today {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.analytics-today__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-3);
}

.analytics-today__card {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-5);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  min-width: 0;
}

.analytics-today__card--accent {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.analytics-today__label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.analytics-today__value {
  font-size: var(--fs-3xl, 2.25rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.analytics-today__sub {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.analytics-today__scopes {
  display: inline-flex;
  gap: var(--s-1);
  padding: var(--s-1);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.analytics-today__scope {
  padding: var(--s-1) var(--s-3);
  font: inherit;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
}

.analytics-today__scope[aria-pressed='true'] {
  color: var(--text);
  background: var(--surface-3);
}

.analytics-today__scope {
  padding: var(--s-1) var(--s-3);
  font: inherit;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
}

.analytics-today__scope[aria-pressed='true'] {
  color: var(--text);
  background: var(--surface-3);
}

.analytics-today__bar {
  fill: var(--brand);
}

.analytics-today__hit {
  fill: transparent;
}

.analytics-today__hit:hover {
  fill: var(--surface-3);
  fill-opacity: 0.5;
}

.analytics-today__scope {
  white-space: nowrap;
}

/* Summary cards (styles.css): 7 cards leave one alone on the last row, so it spans the full width. */
@media (min-width: 641px) {
  .analytics__stats > :last-child:nth-child(3n + 1) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 960px) {
  .analytics-today__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .analytics-today__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .analytics__stats > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .analytics-today__value {
    font-size: var(--fs-2xl);
  }

  .analytics-today__chart-card .card__header {
    flex-direction: column;
    align-items: stretch;
  }

  .analytics-today__chart-card .card__actions {
    width: 100%;
  }

  .analytics-today__scopes {
    display: flex;
  }

  .analytics-today__scope {
    flex: 1;
  }
}
