.group-total {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, max-content));
  gap: 7px;
}

.total-item {
  padding: 6px 9px;
  border: 1px solid #d9e2ef;
  border-radius: 9px;
  background: #fff;
  text-align: center;
}

.total-item span {
  display: block;
  color: #68758a;
  font-size: .72rem;
  line-height: 1.2;
}

.total-item b {
  display: block;
  margin-top: 3px;
  color: #172033;
  font-size: .95rem;
  line-height: 1.25;
}

.total-two b { color: #155eef; }
.total-three b { color: #087a4b; }

.grand-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 28px;
}

.summary .grand-two strong { color: #8fc2ff; }
.summary .grand-three strong { color: #72e0a6; }

@media (max-width: 720px) {
  .group-head {
    flex-wrap: wrap;
  }

  .group-name { order: 1; }
  .delete-group { order: 2; margin-left: auto; }

  .group-total {
    order: 3;
    width: 100%;
    margin-left: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .total-item {
    min-width: 0;
    padding: 6px 3px;
  }

  .total-item b {
    font-size: .86rem;
  }

  .summary {
    align-items: center;
  }

  .grand-totals {
    flex: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .summary .grand-totals strong {
    font-size: 1.05rem;
    white-space: nowrap;
  }

  .summary .grand-totals span {
    font-size: .72rem;
  }
}
