/* History detail layout and compact mobile day/history rules */

.history-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.history-detail-card {
  padding: 14px 12px;
  border-radius: 18px;
}
.history-detail-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.history-detail-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  line-height: 1;
}
.history-day-card {
  padding: 16px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.history-day-card:last-child { margin-bottom: 0; }
.history-day-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  letter-spacing: 1px;
}
.history-day-sub {
  font-size: 11px;
  color: var(--muted2);
  margin-top: 3px;
}
.history-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.history-section:first-of-type {
  margin-top: 16px;
}
.history-section-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.history-sets-missing {
  font-size: 10px;
  color: var(--muted);
}

@media (max-width: 720px){
  .history-toolbar,
  .history-group-head,
  .history-rich-head,
  .history-detail-headline {
    flex-direction: column;
    align-items: flex-start;
  }
  .history-filter-row,
  .history-rich-badges {
    justify-content: flex-start;
  }
  .history-rich-metrics,
  .history-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .history-rich-card,
  .history-day-card,
  .history-explorer {
    padding: 14px;
    border-radius: 18px;
  }
  .history-rich-title {
    white-space: normal;
    line-height: 1.15;
  }
  .history-rich-badges {
    width: 100%;
    gap: 5px;
  }
  .history-rich-badge {
    padding: 4px 7px;
    font-size: 9px;
  }
  .history-rich-metrics {
    gap: 6px;
    margin: 12px 0 10px;
  }
  .history-metric-chip {
    padding: 8px;
    border-radius: 14px;
  }
  .history-metric-value {
    font-size: 20px;
  }
  .history-metric-label {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .history-ex-row {
    padding: 8px 10px;
    border-radius: 14px;
  }
  .history-ex-row-head {
    gap: 8px;
    margin-bottom: 6px;
  }
  .history-ex-name {
    font-size: 12px;
    line-height: 1.2;
    word-break: break-word;
  }
  .history-set-list {
    gap: 5px;
  }
  .history-set-chip,
  .history-record-tag {
    padding: 4px 7px;
    font-size: 9px;
  }
}
@media (max-width: 720px){
  .day-card {
    border-radius: 18px;
  }
  .day-header {
    align-items: flex-start;
    gap: 12px;
    padding: 16px 16px 14px;
  }
  .day-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 22px;
  }
  .day-weekday {
    font-size: 9px;
    letter-spacing: 2px;
  }
  .day-title-input {
    font-size: 24px;
    line-height: 1.05;
  }
  .day-body {
    padding: 10px 14px 14px;
  }
  .ex-row {
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
  }
  .ex-marker {
    margin-top: 8px;
  }
  .ex-name-input,
  .ex-name-display {
    flex: 1 1 calc(100% - 24px);
    width: calc(100% - 24px);
    font-size: 14px;
    line-height: 1.28;
  }
  .ex-sets-wrap {
    margin-left: 17px;
    width: calc(100% - 17px);
    flex-wrap: wrap;
    gap: 5px;
  }
  .ex-sets-pill {
    padding: 4px 8px;
    gap: 3px;
  }
  .sets-input,
  .reps-input {
    font-size: 13px;
  }
  .sets-input {
    width: 28px;
  }
  .reps-input {
    width: 30px;
  }
  .sets-label,
  .rir-badge,
  .rir-input {
    font-size: 9px;
  }
  .rir-badge,
  .rir-input {
    padding: 4px 7px;
    border-radius: 8px;
  }
}
@media (max-width: 430px){
  .day-header {
    padding: 14px 14px 12px;
    gap: 10px;
  }
  .day-badge {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  .day-title-input {
    font-size: 20px;
    line-height: 1;
  }
  .day-body {
    padding: 8px 12px 12px;
  }
  .section-head {
    margin-bottom: 8px;
  }
  .ex-row {
    gap: 7px;
    padding: 7px 8px;
  }
  .ex-name-input,
  .ex-name-display {
    font-size: 13px;
  }
  .ex-sets-wrap {
    margin-left: 15px;
    width: calc(100% - 15px);
    gap: 4px;
  }
  .ex-sets-pill {
    padding: 3px 7px;
    border-radius: 8px;
  }
  .sets-input,
  .reps-input {
    font-size: 12px;
  }
  .sets-input {
    width: 24px;
  }
  .reps-input {
    width: 26px;
  }
  .sets-label,
  .rir-badge,
  .rir-input {
    font-size: 8px;
  }
  .history-rich-card,
  .history-day-card,
  .history-explorer {
    padding: 12px;
    border-radius: 16px;
  }
  .history-rich-metrics,
  .history-detail-grid {
    gap: 5px;
  }
  .history-metric-chip {
    padding: 7px;
  }
  .history-metric-value {
    font-size: 18px;
  }
  .history-rich-title {
    font-size: 15px;
  }
  .history-rich-date,
  .history-ex-date {
    font-size: 10px;
  }
}
