.tabs .tabs-list {
  display: flex;
  gap: 0.5ch;
  max-width: 100%;
  font-size: var(--body-font-size-xs);
  overflow-x: auto;
}

@media (width >= 600px) {
  .tabs .tabs-list {
    font-size: var(--body-font-size-s);
  }
}

@media (width >= 900px) {
  .tabs .tabs-list {
    font-size: var(--body-font-size-m);
  }
}

.tabs .tabs-list button {
  flex: 0 0 max-content;
  margin: 0;
  border: 1px solid var(--dark-color);
  border-radius: 0;
  padding: 0.5em;
  background-color: var(--muted-color-alt);
  color: initial;
  font-weight: bold;
  line-height: unset;
  text-align: initial;
  text-overflow: unset;
  overflow: unset;
  white-space: unset;
  transition: background-color 0.2s;
}

.tabs .tabs-list button p {
  margin: 0;
}

.tabs .tabs-list button[aria-selected='true'] {
  border-bottom: 1px solid var(--background-color);
  background-color: var(--background-color);
  cursor: initial;
}

.tabs .tabs-panel {
  margin-top: -1px;
  padding: 24px;
  border: 1px solid var(--dark-color);
  overflow: auto;
}

.tabs .tabs-panel[aria-hidden='true'] {
  display: none;
}

/* --- variant: top (page title + small series-switcher badge links, source-style) --- */
.tabs.top .tabs-top-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tabs.top h1 {
  margin: 0;
}

.tabs.top .tabs-top-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tabs.top .tabs-top-links a,
.tabs.top .tabs-top-links picture {
  line-height: 0;
}

.tabs.top .tabs-top-links img {
  width: auto;
  height: 40px;
}

@media (width >= 768px) {
  .tabs.top .tabs-top-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
