#evolution {
  padding-bottom: calc(var(--bottom-nav-height, 74px) + 34px);
}

#evolution .card {
  margin-top: 14px;
}

.evolution-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.record-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.evolution-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--bf-line);
  border-radius: 12px;
  background: #111;
}

.evolution-record > div:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.evolution-record span {
  color: var(--bf-muted);
  font-size: 0.75rem;
}

.evolution-record.stacked {
  display: block;
}

.record-heading,
.record-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.record-actions button {
  min-height: 44px;
  padding-inline: 10px;
  font-size: 0.65rem;
}

.measurement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.measurement-grid span {
  display: grid;
  gap: 2px;
  padding: 9px;
  border-radius: 9px;
  background: #171717;
}

.measurement-grid b {
  color: #fff;
}

.comparison-selectors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.comparison-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.comparison-summary > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--bf-line);
  border-radius: 11px;
  background: #111;
}

.comparison-summary small {
  color: var(--bf-muted);
}

.comparison-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.comparison-photos figure {
  margin: 0;
}

.comparison-photos img {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  object-fit: cover;
}

.comparison-photos figcaption {
  margin-top: 5px;
  color: var(--bf-muted);
  font-size: 0.72rem;
}

.comparison-photo-empty {
  margin-top: 12px;
}

.progress-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.progress-photo-grid > article {
  overflow: hidden;
  border: 1px solid var(--bf-line);
  border-radius: 12px;
  background: #111;
}

.photo-preview {
  width: 100%;
  height: 170px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #090909;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.progress-photo-grid article > div {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
}

.progress-photo-grid article > div span {
  color: var(--bf-muted);
  font-size: 0.75rem;
}

.progress-photo-grid article > .danger {
  width: calc(100% - 16px);
  min-height: 44px;
  margin: 0 8px 8px;
}

.evolution-timeline {
  display: grid;
  gap: 0;
  margin-top: 14px;
}

.evolution-timeline article {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  min-height: 58px;
  padding-bottom: 14px;
}

.evolution-timeline article::before {
  position: absolute;
  top: 5px;
  left: 98px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bf-red);
  box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.13);
  content: "";
}

.evolution-timeline article::after {
  position: absolute;
  top: 16px;
  bottom: 0;
  left: 101px;
  width: 1px;
  background: var(--bf-line);
  content: "";
}

.evolution-timeline article:last-child::after {
  display: none;
}

.evolution-timeline time {
  color: var(--bf-muted);
  font-size: 0.72rem;
}

.evolution-timeline article > div {
  display: grid;
  gap: 2px;
  padding-left: 12px;
}

.evolution-timeline span {
  color: var(--bf-muted);
  font-size: 0.77rem;
}

.chart-goal {
  stroke: #62cf83;
  stroke-width: 1.5;
  stroke-dasharray: 7 5;
}

.chart-goal-label {
  fill: #8be5a4;
  font-size: 10px;
}

.chart-point.endpoint {
  fill: #fff;
  stroke: var(--bf-red);
  stroke-width: 3px;
}

.evolution-editor-dialog {
  max-height: min(88vh, 720px);
  overflow: auto;
}

#evolutionEditorForm {
  display: grid;
  gap: 11px;
  margin-top: 14px;
}

#evolutionEditorForm label {
  display: grid;
  gap: 6px;
  color: var(--bf-muted);
  font-size: 0.78rem;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.evolution-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 9px;
  margin-top: 16px;
}

.evolution-editor-actions button {
  min-height: 48px;
}

.photo-viewer {
  position: fixed;
  z-index: 110;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.94);
}

.photo-viewer img {
  max-width: 100%;
  max-height: calc(100vh - 100px);
  object-fit: contain;
}

@media (max-width: 430px) {
  .evolution-record {
    align-items: flex-start;
    flex-direction: column;
  }

  .evolution-record .record-actions {
    width: 100%;
  }

  .record-actions button {
    flex: 1;
  }

  .editor-grid {
    grid-template-columns: 1fr;
  }
}
