.service-section {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.service-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.results-panel .service-title-row h3,
.results-panel .service-history h3 {
  margin: 0;
}

.service-status {
  padding: .3rem .48rem;
  color: var(--color-primary-deep);
  background: var(--color-primary-soft);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .55rem;
  font-weight: 850;
  letter-spacing: .08em;
}

.service-empty {
  margin: var(--space-3) 0 0;
  padding: var(--space-3);
  color: var(--color-muted);
  background: var(--color-surface-soft);
  border-left: 3px solid var(--color-border-strong);
  font-size: .7rem;
  line-height: 1.5;
}

.service-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: var(--space-3) 0 0;
  overflow: hidden;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.service-profile-grid[hidden],
.service-history[hidden] {
  display: none;
}

.service-profile-item {
  min-width: 0;
  padding: .7rem;
  background: var(--color-surface-soft);
}

.service-profile-item.is-wide {
  grid-column: 1 / -1;
}

.service-profile-item dt {
  color: var(--color-muted);
  font-size: .55rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.service-profile-item dd {
  margin: .22rem 0 0;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 750;
  line-height: 1.35;
}

.service-history {
  margin-top: var(--space-5);
}

.service-periods {
  margin-top: var(--space-2);
  border-top: 1px solid var(--color-border-strong);
  border-bottom: 1px solid var(--color-border-strong);
}

.history-list-head,
.service-period-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .95fr) minmax(0, .72fr) minmax(0, 1fr);
  align-items: center;
  column-gap: .2rem;
}

.history-list-head {
  height: 22px;
  color: var(--color-muted);
  background: var(--color-surface-soft);
  font-size: .46rem;
  font-weight: 850;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.history-list-head span,
.period-cell {
  min-width: 0;
  padding-inline: .16rem;
  white-space: nowrap;
}

.history-list-head span:not(:first-child),
.period-number {
  text-align: right;
}

.service-period-row {
  height: 26px;
  background: transparent;
  border-bottom: 1px solid var(--color-border);
}

.service-period-row:last-child {
  border-bottom: 0;
}

.period-cell {
  font-family: var(--font-mono);
  font-size: .55rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.period-date {
  color: var(--color-muted);
  text-transform: capitalize;
}

.period-consumption {
  font-weight: 800;
  text-align: right;
}

@media (min-width: 1181px) {
  .workspace {
    height: calc(100vh - 60px);
    min-height: 0;
  }
}

@media (max-width: 700px) {
  .history-list-head,
  .service-period-row {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .88fr) minmax(0, .72fr) minmax(0, 1fr);
  }

  .history-list-head {
    font-size: .42rem;
  }

  .period-cell {
    font-size: .5rem;
  }
}

@media (max-width: 380px) {
  .service-profile-grid {
    grid-template-columns: 1fr;
  }

  .service-profile-item.is-wide {
    grid-column: auto;
  }

}
