.mp-tabs-ready .mp-index {
  position: sticky;
  z-index: 2;
  top: 82px;
  padding-block: 7px;
  background: var(--paper);
}

.mp-tablist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mp-tablist button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  transition: background .3s, color .3s, border-color .3s;
}

.mp-tablist button span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: #dcece9;
  color: var(--dark);
  font-size: 13px;
}

.mp-tablist button:hover { background: #eaf2f3; border-color: var(--accent); }
.mp-tablist button[aria-selected="true"] {
  background: var(--dark);
  border-color: var(--dark);
  color: white;
}

/* The tallest panel sets the shared row height at the current width. */
.mp-tabs-ready .mp-stages { display: grid; }
.mp-tabs-ready .mp-stage {
  grid-area: 1 / 1;
  visibility: hidden;
  border: 0;
  padding-block: clamp(18px, 3vw, 46px);
}

.mp-tabs-ready .mp-panel-active {
  visibility: visible;
  animation: mp-tab-enter .3s var(--ease) both;
}

@keyframes mp-tab-enter {
  from { opacity: .52; }
  to { opacity: 1; }
}

@media (max-width: 850px) {
  .mp-tablist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 590px) {
  .mp-tabs-ready .mp-index { top: 65px; }
  .mp-tablist button { padding: 7px 8px; min-height: 48px; gap: 6px; font-size: 12px; }
  .mp-tablist button span { flex-basis: 24px; height: 24px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .mp-tablist button { transition: none; }
  .mp-tabs-ready .mp-panel-active { animation: none; }
}
