:root {
  --task-border: #d9dde3;
  --slot-border: #eceff3;
}

/* --- page header ----------------------------------------------------- */

.page-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.page-header h1 {
  margin-bottom: 0.25rem;
}

.page-header p:last-child {
  margin-bottom: 0;
}

.muted {
  color: var(--pico-muted-color);
}

/* --- nav ------------------------------------------------------------- */

.nav-form {
  margin: 0;
}

.nav-form button {
  width: auto;
  margin: 0;
  padding: 0.3rem 0.9rem;
  font-size: 0.85rem;
}

/* --- login ----------------------------------------------------------- */

.login-card {
  max-width: 24rem;
  margin: 4rem auto;
}

.login-card h1 {
  margin-bottom: 0.25rem;
}

.login-card button {
  width: 100%;
}

/* --- tasks ----------------------------------------------------------- */

.task {
  margin-bottom: 1.25rem;
}

.task-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  justify-content: space-between;
}

.task-header h2 {
  margin: 0;
}

.task-description {
  margin: 0.75rem 0 1rem;
  color: var(--pico-color);
  white-space: pre-line;
}

/* --- one task line --------------------------------------------------- */

.slots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.slot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  margin: 0;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--slot-border);
}

.slot:last-child {
  border-bottom: none;
}

.slot-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  width: 100%;
}

.slot-form input[type="text"] {
  flex: 1 1 12rem;
  margin: 0;
  height: 2.4rem;
}

.slot-form button {
  width: auto;
  margin: 0;
  padding: 0.45rem 0.9rem;
  white-space: nowrap;
}

.slot-name {
  flex: 1 1 12rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.4rem;
}

.slot-name .name {
  font-weight: 600;
}

.slot-actions {
  display: flex;
  gap: 0.4rem;
}

.slot-actions button {
  width: auto;
  margin: 0;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
}

.slot.is-editing {
  background: var(--pico-form-element-background-color, #f7f8fa);
  border-radius: 0.35rem;
}

.badge {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--pico-primary-background, #0172ad);
  color: var(--pico-primary-inverse, #fff);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.error {
  flex: 1 0 100%;
  margin: 0.15rem 0 0;
  color: var(--pico-del-color, #b3261e);
}

/* the inputs of a task line sit inside a card, keep the card calm */
.slot input {
  margin-bottom: 0;
}
