.tabs {
  display: flex;
  flex-wrap: wrap;
  margin: 2rem auto;
  max-width: 70ch;
}

/* Fill the content area instead of the narrow 70ch reading column — for tab
   pages whose body is data (lists/tables), not prose. */
.tabs--fill {
  margin-block: 1.5rem;
  margin-inline: 0;
  max-width: none;
}

.tabs label {
  cursor: pointer;
  display: block;
  font-weight: 600;
  margin-right: 0.3rem;
  order: initial;
  padding: 1rem 2rem;
  transition: background ease 0.3s;
  width: 100%;
}

.tabs .tab-content {
  display: none;
  flex-grow: 1;
  padding: 1rem;
  width: 100%;
}

.tabs input[type="radio"] {
  display: none;
}

.tabs input[type="radio"]:checked + label {
  background: var(--color-primary);
  color: var(--color-gray-0);
}

.tabs input[type="radio"]:checked + label + .tab-content {
  display: block;
}

@media (min-width: 10em) {
  .tabs .tab-content {
    order: 99;
  }

  .tabs label {
    order: 1;
  }

  .tabs label {
    margin-right: 0.3rem;
    margin-top: 0;
    width: auto;
  }
}

/* Opt-in mobile accordion: pages add this only where their tabs overflow, so
   tab sets that still fit keep the inline row. Dropping the label/panel order
   opens each panel under its label. .tabs is doubled to beat the min-width:10em
   order rules. */
@media (max-width: 560px) {
  .tabs.tabs--accordion-mobile {
    gap: 0.3rem;
    border-bottom: none;
  }

  .tabs.tabs--accordion-mobile > label {
    order: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: 0;
    padding: 0.7rem 1rem;
    border: 1px solid var(--color-border, rgba(128, 128, 128, 0.3));
    border-radius: 6px;
  }

  .tabs.tabs--accordion-mobile > label::after {
    content: "▸";
    margin-left: auto;
    opacity: 0.55;
    font-size: 0.85em;
  }

  .tabs.tabs--accordion-mobile > input[type="radio"]:checked + label {
    border-radius: 6px 6px 0 0;
  }

  .tabs.tabs--accordion-mobile > input[type="radio"]:checked + label::after {
    content: "▾";
  }

  .tabs.tabs--accordion-mobile > .tab-content {
    order: 0;
    box-sizing: border-box;
    border: 1px solid var(--color-border, rgba(128, 128, 128, 0.3));
    border-top: none;
    border-radius: 0 0 6px 6px;
  }
}
