/* Custom styles for the Meeting Cost Calculator (on top of nhsuk-frontend). */

/* ---------- Live cost panel ---------- */

.nhsuk-panel--cost {
  border-radius: 0; /* nhsuk panels are square */
}

.nhsuk-panel--cost .nhsuk-tag--state {
  float: right;
  background: #fff;
  color: #212b32;
}

#live-cost {
  font-size: 3rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

#live-timer {
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.nhsuk-panel--cost .nhsuk-panel__body-cost {
  margin: 0 0 0.5rem 0;
}

.nhsuk-panel--paused {
  background-color: #4c6272; /* darker, muted variant while paused */
}

/* ---------- Setup table ---------- */

.nhsuk-table td.nhsuk-table__cell--num,
.nhsuk-table th.nhsuk-table__header--num {
  text-align: right;
  vertical-align: middle;
}

/* Band label sits on its own line with a gap above the hint text. */
.nhsuk-table__cell--band {
  display: block;
  margin-bottom: 4px;
}

/* Same treatment in the live editor ("Who's here" rows). */
.live-row__label .nhsuk-hint {
  display: block;
  margin-top: 4px;
}

/* Stepper (minus / number / plus) */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.stepper__btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid #005eb8;
  background: #ffffff;
  color: #005eb8;
  border-radius: 0;
  font-weight: 700;
  line-height: 36px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stepper__btn:hover {
  background: #f0f4f5;
  box-shadow: none;
}

.stepper__btn:focus {
  outline: 4px solid #ffb81c;
  outline-offset: 0;
}

.stepper__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stepper .nhsuk-input {
  width: 64px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Unbanded role rows */
.role-row {
  display: grid;
  grid-template-columns: 1fr 150px 140px 90px 36px;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}

.role-row .nhsuk-form-group {
  margin-bottom: 0;
}

.role-row__remove {
  width: 36px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #005eb8;
  text-decoration: underline;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.role-row__remove:hover {
  color: #7c2855;
}

.role-row__remove:focus {
  outline: 4px solid #ffb81c;
  outline-offset: 0;
}

.role-row__derived {
  font-size: 0.875rem;
  color: #4c6272;
  white-space: nowrap;
}

/* ---------- Live editor ---------- */

.live-row {
  padding: 0.75rem 0;
  border-bottom: 1px solid #d8dde0;
}

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

.live-row__label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* ---------- Summary ---------- */

#summary-total {
  font-variant-numeric: tabular-nums;
}

/* ---------- Summary chart ---------- */

.summary-chart__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.summary-donut {
  width: 140px;
  height: 140px;
  flex: 0 0 auto;
}

.summary-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 180px;
  min-width: 180px;
}

.summary-legend__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-legend__item + .summary-legend__item {
  margin-top: 0.375rem;
}

.summary-legend__swatch {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 2px;
  flex: 0 0 auto;
}

/* ---------- Small screens ---------- */

@media (max-width: 40.0525em) {
  .role-row {
    grid-template-columns: 1fr 1fr;
  }
  .role-row__derived {
    grid-column: 1 / -1;
  }

  #live-cost {
    font-size: 2.4rem;
  }
}