/* Dashboard: cards two to a row, and nutrients as progress toward their daily targets */

/* Time tracking is paused, as TIME_TRACKING_ENABLED is in public-personal-api. To show it again, delete this rule
   and say 4 apps in index.html. */
[data-source="time-tracker"] {
  display: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.grid > .card {
  margin-bottom: 0;
}

.meters {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

.meters li {
  display: grid;
  grid-template-columns: minmax(6rem, 1fr) 2fr minmax(7rem, auto);
  align-items: center;
  gap: 12px;
  padding: 3px 0;
}

.meter {
  height: 6px;
  border-radius: 3px;
  background: var(--empty);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.meter .met {
  background: var(--met);
}

/* Today's nutrition: one macro per line under its pie, its kcal, grams and percent in columns */
#nutrition-day .legend {
  display: grid;
  grid-template-columns: repeat(7, auto);
  justify-content: start;
  align-items: center;
  gap: 4px 0.4em;
  font-variant-numeric: tabular-nums;
}

#nutrition-day .legend li {
  display: contents;
}

#nutrition-day .legend li > :nth-child(n + 3) {
  text-align: right;
}

/* Weight trends' legend: a weigh-in's dot, and the dashed line across a week with none */
.swatch.dot {
  border-radius: 50%;
  opacity: 0.5;
}

.swatch.dash {
  width: 14px;
  height: 2px;
  border-radius: 0;
  vertical-align: middle;
  opacity: 0.6;
  mask: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 7px);
}

/* The intro's live line: its dot is green and pulses */
.intro .live::before {
  background: var(--met);
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  from {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--met) 60%, transparent);
  }
  to {
    box-shadow: 0 0 0 7px transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro .live::before {
    animation: none;
  }
}
