/* --- Two-column form grid (desktop/tablet) --- */
.two-col-grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: start;
  max-width: 600px;
  margin: 1rem 0;
}

.two-col-grid > label {
  font-weight: bold;
}

.two-col-grid label,
.two-col-grid legend {
  text-align: right;
}

.two-col-grid input,
.two-col-grid select,
.two-col-grid button {
  max-width: 100%;
  box-sizing: border-box;
}

.two-col-grid fieldset {
  border: none;
  display: contents;
}

.two-col-grid fieldset legend {
  grid-column: 1; /* redundant, but documented here, to show legend will go in column 1 since fieldset has display: contents; */
  font-weight: bold;
  align-self: center;
}

.two-col-grid fieldset > div {
  grid-column: 2; /* see '.two-col-grid fieldset legend' comment above */
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.label-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  justify-content: flex-end;
}

.label-checkbox label {
  font-weight: bold;
  text-align: right;
  white-space: nowrap;
}

.history-button {
  padding-top: 0;
  padding-bottom: 0;
  padding-right: 0.25rem;
  padding-left: 0.25rem;
  border-width: 1px;
  border-radius: 5px;
}

.history-button.right {
  margin-right: 0.25rem;
}

.history-button.left {
  margin-left: 0.25rem;
}

.word-list-label {
  font-weight: bold;
  font-size: smaller;
}

.word-list-item {
  font-size: x-small;  
}

/* Responsive layout for narrow viewports */
@media (max-width: 600px) {
  .two-col-grid {
    grid-template-columns: 1fr;
  }

  .two-col-grid label,
  .two-col-grid legend {
    text-align: left;
  }

  .two-col-grid fieldset legend {
    margin-bottom: 0.5rem;
  }

  .two-col-grid fieldset > div {
    grid-column: 1;
    justify-content: flex-start;
  }
}
